Asymptotic Notations
Asymptotic Notations
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 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.
(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.
}
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)