0% found this document useful (0 votes)
63 views23 pages

Analysis and Design of Algorithm (ADA) : Module-1

This document discusses asymptotic notations for analyzing algorithms. It introduces Big-O, Big-Omega, and Theta notations to describe the worst-case, best-case, and average-case time complexities of algorithms. Common time complexities are constant, logarithmic, linear, quadratic, and exponential. Examples are provided to demonstrate how to determine the asymptotic notation that describes the growth rate of a function. Numerical examples are then given to illustrate how to identify the asymptotic notation of an algorithm's time complexity.

Uploaded by

Nitish Solanki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views23 pages

Analysis and Design of Algorithm (ADA) : Module-1

This document discusses asymptotic notations for analyzing algorithms. It introduces Big-O, Big-Omega, and Theta notations to describe the worst-case, best-case, and average-case time complexities of algorithms. Common time complexities are constant, logarithmic, linear, quadratic, and exponential. Examples are provided to demonstrate how to determine the asymptotic notation that describes the growth rate of a function. Numerical examples are then given to illustrate how to identify the asymptotic notation of an algorithm's time complexity.

Uploaded by

Nitish Solanki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Analysis and Design of Algorithm(ADA)

Module-1
Asymptotic Notations

O(Big-Oh), Ω (Big-Omega) and

1
OBJECTIVES
After completing this section, you will be able to

 Understand the class of Functions

 Explain the need and significance of Asymptotic Notation

 Differentiate (mathematically) between asymptotic notations


-,
-
-

2
Growth of Functions
Class Name Example
Constant f(n)=1, or f(n)=7 or f(n)=500

Logrithemic Binary search


Linear time Linear search or f(n)=3n+2 or f(n)=10n+500
or n/700+5 =O(1)
Poly logrithemic Merge sort

Quadratic Matrix addition


Cubic Matrix Multiplication
or Exponential TOH
Factorial TSP (using brute force method)

3
Growth of functions(increasing order)

4
Asymptotic Notations- (O, Ω, and θ)
The basic Asymptotic Notations are:
1. O(Big-“Oh”) Notation. [Maximum number of steps to
solve a problem, (upper bound)]

2. Ω (Big-“Omega”) Notation [Minimum number of steps to


solve a problem, (lower bound)]

3. (Theta) Notation [Average number of steps to solve a


problem, (Average bound)]

Note: Any function can be represented either in Upper bound or in Lower


bound or in Average bound
5
 Time complexity of the algorithm may be any
one of these:
) …

 If complexity is not among these, then may be between


two class listed here. Then we go for O or Ω notations.

6
Hint:
Log property: )
7
(Big)-O Notation
 

Lower bound Upper bound

8
9
10
Ω Notation (example)
•  
 
 

<n

Lower bound Upper bound

11
Hint: since

12
Theta (Notation (Example)
•  
 
 
 

Lower bound Upper bound

13
Analysis and Design of Algorithm(ADA)

Module-1[Lecture-2]
Asymptotic Notations-Numerical

O(Big-Oh), Ω (Big-Omega) and

14
OBJECTIVES
After completing this section, you will be able to

 Differentiate between ,

 Numerical questions on .

 Check your progress on .

15
) …

• …,,,mm𝑛(𝑛+1)/2

16
) …

Example2:
we can write

17
) …

Example3:

we can write

Note: Both side not getting same function, so for n! , tight bound
not possible, so we can write

18
) …

Example4:

we can write

Note: Again, Both side not getting same function, so for , tight
bound not possible, so we can write
19
Check your progress1:
•  

20
Check your progress2
•  

21
Check your progress3:
•  

22
Check your progress4
𝑛)/2

23

You might also like