Intro To Algorithm Analysis
Intro To Algorithm Analysis
1
Module 1: Introduction to Algorithm
Analysis
2
Data Structures
3
Data Structures
4
Data Structures
5
Algorithm
6
Algorithm
Characteristics of an Algorithm
7
Algorithm
Why are Algorithms Important to Understand?
8
Algorithm
Steps in Designing and Analyzing an Algorithm
9
Algorithm
Steps in Designing and Analyzing an Algorithm
10
Algorithm
Steps in Designing and Analyzing an Algorithm
11
Types of Algorithms
12
Types of Algorithms
14
Analysis of Algorithms
Issues:
Correctness
time efficiency
space efficiency
Optimality
Approaches:
theoretical analysis
empirical analysis
15
Theoretical Analysis of Time Efficiency
Time efficiency is analyzed by determining the number of
repetitions of the basic operation as a function of input size
Basic operation: the operation that contributes most towards the
running time of the algorithm
input size
T(n) ≈ copC(n)
running time execution Number of
time times basic
for basic operation is
operation executed
16
Empirical Analysis of Time Efficiency
17
Why Analysis of Algorithms is important?
18
Algorithm Complexity
19
Analysis Framework
Space Complexity
21
Space Complexity
23
Example: Sequential search
Best-case, average-case, worst-case
Exact formula
e.g., C(n) = n(n-1)/2
Little ω Notations
Little omega (ω) notation is used to describe a loose lower
bound of f(n).
Example 1: Maximum Element
Example 2: Element Uniqueness
Problem
Example 2: Element Uniqueness
Problem