Lecture 2 DSA
Lecture 2 DSA
Algorithms
Adil M. Khan
Innopolis University
Lecture 2
Which Phone Will You
Buy, and Why?
Which Car Will You Buy,
and Why?
Which Sorting Algorithm
Will You Choose and
• Insertion Sort Why?
• Selection Sort
• Merge Sort
• Quick Sort
Today’s Objectives
• Learn and be able to describe what is ―Algorithm
Analysis‖
• Determine whether a
proposed solution will meet
required resource
constraints before we invest
money and time coding
You can see their past (to judge their behavior) but you have to choose
Thus
Example (cont.)
This can be expressed as
allows us to express
severity of winters of
any place in terms of
Russian winters
Big O Analysis
Big Oh Analysis
Big Oh Analysis
• Reflexivity
• Symmetry
• Transpose Symmetry
Growth Rates of Common
Functions
Growth Rates of Common
Functions
Space Complexity
• Determine how much space an algorithm requires by
analyzing its storage requirements as a function of the
input size
• Example: