0% found this document useful (0 votes)
86 views

Asymptotic Notations

The document discusses asymptotic notations used to analyze the time complexity of algorithms. It explains that asymptotic analysis involves calculating mathematical bounds for an algorithm's best, average, and worst case running times. Common notations include Big O notation (Ο) for worst case upper bound, Omega notation (Ω) for best case lower bound, and Theta notation (θ) for both upper and lower bounds. Examples of common time complexities are constant (Ο(1)), logarithmic (Ο(log n)), linear (Ο(n)), quadratic (Ο(n2)), and exponential (2Ο(n)).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views

Asymptotic Notations

The document discusses asymptotic notations used to analyze the time complexity of algorithms. It explains that asymptotic analysis involves calculating mathematical bounds for an algorithm's best, average, and worst case running times. Common notations include Big O notation (Ο) for worst case upper bound, Omega notation (Ω) for best case lower bound, and Theta notation (θ) for both upper and lower bounds. Examples of common time complexities are constant (Ο(1)), logarithmic (Ο(log n)), linear (Ο(n)), quadratic (Ο(n2)), and exponential (2Ο(n)).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Sanskrithi School of Engineering

(Affiliated to JNTUA, Ananthapur & Approved by AICTE, New Delhi)


Puttaparthi-515 134.

Data Structures
Asymptotic notations :
Asymptotic analysis of an algorithm, refers to defining the mathematical
boundation/framing of its run-time performance. Using asymptotic
analysis, we can very well conclude the best case, average case and
worst case scenario of an algorithm.

Asymptotic analysis are input bound i.e., if there's no input to the


algorithm it is concluded to work in a constant time. Other than the
"input" all other factors are considered constant.

Asymptotic analysis refers to computing the running time of any


operation in mathematical units of computation. For example, running
time of one operation is computed as f(n) and may be for another
operation it is computed as g(n2). Which means first operation running
time will increase linearly with the increase in n and running time of
second operation will increase exponentially when n increases. Similarly
the running time of both operations will be nearly same if n is
significantly small.

Usually, time required by an algorithm falls under three types

Best Case Minimum time required for program execution.

Average Case Average time required for program execution.

Worst Case Maximum time required for program execution.

Asymptotic Notations
Following are commonly used asymptotic notations used in calculating
running time complexity of an algorithm.

Notation

Notation

Notation
Sanskrithi School of Engineering
(Affiliated to JNTUA, Ananthapur & Approved by AICTE, New Delhi)
Puttaparthi-515 134.

Big Oh Notation,
The (n) is the formal way to express the upper bound of an algorithm's
running time. It measures the worst case time complexity or longest
amount of time an algorithm can possibly take to complete. For example,
for a function f(n)

(f(n)) = { g(n) : there exists c > 0 and n0 such that g(n) c.f(n) for all n >
n0. }

Omega Notation,
The (n) is the formal way to express the lower bound of an algorithm's
running time. It measures the best case time complexity or best amount
of time an algorithm can possibly take to complete.

For example, for a function f(n)

(f(n)) { g(n) : there exists c > 0 and n0 such that g(n) c.f(n) for all n >
n0.

Theta Notation,
The (n) is the formal way to express both the lower bound and upper
bound of an algorithm's running time. It is represented as following

(f(n)) = { g(n) if and only if g(n) = (f(n)) and g(n) = (f(n)) for all n > n0.
}

Common Asymptotic Notations


constant (1)

logarithmic (log n)

linear (n)
Sanskrithi School of Engineering
(Affiliated to JNTUA, Ananthapur & Approved by AICTE, New Delhi)
Puttaparthi-515 134.

n log n (n log n)

quadratic (n2)

cubic (n3)

polynomial n(1)

exponential 2(n)

You might also like