Professional Documents
Culture Documents
PCC-CS404
PCC-CS404
Asymptotic Notation
Submitted by
Name: Abhiraj Bose
Department: Computer Science and Engineering(CSE)
Semester: 4th
Roll Number: 16900122060
InTRoduCTIon
Asymptotic Notations are mathematical tools that allow you to analyze an algorithm’s running
time by identifying its behavior as its input size grows.
This is also referred to as an algorithm’s growth rate.
You can’t compare two algorithm’s head to head.You compare space and time complexity using
asymptotic analysis.It compares two algorithms based on changes in their performance as the
input size is increased or decreased.
There are mainly three asymptotic notations:
Big-O Notation (O-notation)
Omega Notation (Ω-notation)
Theta Notation (Θ-notation)
An algorithm may not have the same performance for different types of inputs. With the increase
in the input size, the performance will change.
The study of change in performance of the algorithm with the change in the order of the input
size is defined as asymptotic analysis.
Asymptotic notations are the mathematical notations used to describe the running time of an
algorithm when the input tends towards a particular value or a limiting value.
For example: In bubble sort, when the input array is already sorted, the time taken by the
algorithm is linear i.e. the best case.
But, when the input array is in reverse condition, the algorithm takes the maximum time
(quadratic) to sort the elements i.e. the worst case.
When the input array is neither sorted nor in reverse order, then it takes average time. These
durations are denoted using asymptotic notations.
A simple way to get the Theta notation of an expression is to drop low-order terms and ignore
leading constants.
For example, Consider the expression 3n3 + 6n2 + 6000 = Θ(n3), the dropping lower order terms
is always fine because there will always be a number(n) after which Θ(n3) has higher values than
Θ(n2) irrespective of the constants involved.
For a given function g(n), we denote Θ(g(n)) is following set of functions.
Examples : { 100 , log (2000) , 10^4 } belongs to Θ(1) { (n/4) , (2n+3) , (n/100 + log(n)) }
belongs to Θ(n) { (n^2+n) , (2n^2) , (n^2+log(n))} belongs to Θ( n2)
Note: Θ provides exact bounds.
ConCLuSIon
Asymptotic Notation is used to describe the running time of an algorithm - how much time an
algorithm takes with a given input, n. There are three different notations: big O, big Theta (Θ),
and big Omega (Ω). big-Θ is used when the running time is the same for all cases, big-O for the
worst case running time, and big-Ω for the best case running time.
ReFeRenCeS
1. “Data Structures and Program Design In C”, 2/E by Robert L. Kruse, Bruce P. Leung.
2. “Fundamentals of Data Structures of C” by Ellis Horowitz, Sartaj Sahni, Susan Anderson-
freed.
3. “Data Structures in C” by Aaron M. Tenenbaum.
4. “Data Structures” by S. Lipschutz.