Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Asymptotic Notation

Asymptotic Notation is a mathematical notation used to describe the


behavior of a function when the input is large. In this presentation, we
will cover the basics and applications of Asymptotic Notation.
Definition of Asymptotic Notation

Big O notation Omega notation


Defines an upper bound on the growth Defines a lower bound on the growth rate
rate of the algorithm in the worst-case of the algorithm in the best-case
scenario. scenario.

Theta notation Small o notation


Defines both upper and lower bounds on Defines an upper bound that is not tight. It
the growth rate of the algorithm. It indicates that the growth rate of the
provides a tight bound of the growth rate algorithm is less than that of another
of the algorithm. function.
Uses and Applications of Asymptotic
Notation
1 Comparing different algorithms
Asymptotic Notation helps to compare different algorithms and their efficiency. It
helps to choose the algorithm that performs better for a given set of data.

2 Analyzing algorithm complexity


It helps to analyze the complexity of an algorithm with respect to input size. It
helps to determine the time and space requirements for running an algorithm.

3 Predicting performance
Asymptotic Notation helps to predict the performance of an algorithm. It provides
information about how the performance of an algorithm will change with the
input size.
Big O Notation in detail

Definition Example
Big O is an upper bound on the growth rate of An algorithm that runs in O(n) means that its
an algorithm. It describes the worst-case time complexity increases linearly with the
scenario for an algorithm. input size n.
Omega Notation in detail
1 Definition
Omega is a lower bound on the growth rate of an algorithm. It describes the best-
case scenario for an algorithm.

2 Example
An algorithm that runs in Ω(1) has a constant runtime. Its time complexity remains
the same, no matter how large the input size n is.

3 Application
Omega notation is useful for finding the best-case scenario for an algorithm.
Theta Notation in detail
Definition Example
Theta notation is a tight bound An algorithm that runs in Θ(n^2)
between Big O and Omega notations. It means that its time complexity grows
describes the exact growth rate of an quadratically with the input size n.
algorithm.

Application
Theta notation is useful for finding the exact complexity of an algorithm.
Small O Notation in detail

Definition Example
Small o is an upper bound that is not tight. It An algorithm that runs in o(n^2) would have a
indicates that the growth rate of the algorithm faster growth rate than an algorithm that runs
is less than that of another function. in Θ(n^2).
Advantages of Using Asymptotic
Notations
1 Simplicity
Asymptotic Notations are simple to understand and apply.

2 Widely Accepted
Asymptotic Notations are widely used in computer science and software
engineering.

3 Efficiency
They help to choose the most efficient algorithm for a given data set and
predict its performance.

You might also like