Asymptotic Notations
There are 3 main asymptotic notations to denote time complexity:
Big-O (O)
Big-Omega (Ω)
Big-Theta (Θ)
We also have little-o (o) and little-omega (ω)
Big-O (O)
Big-O is the most commonly used notation. It denotes the worst-case time complexity.
We say f(n) = O(g(n)) iff there exists some constant c>0, and n0 such that f(n) <= c.g(n) for all n >= n0
g(n) will be the upper-bound for f(n).
Big-Omega (Ω)
We say f(n) = Ω(g(n)) iff there exists some constant c>0, and n0 such that f(n) >= c.g(n) for all n >= n0
g(n) will be the lower-bound for f(n).
Big-Theta (Θ)
We say f(n) = Θ(g(n)) iff there exist some constants c1 and c2, and n0 such that c1.g(n) <= f(n) <= c2.g(n) for all n >= n0
g(n) will be both the upper and lower bound for f(n), for certain constants c1 and c2.
Little-o (o)
We say f(n) = o(g(n)) iff f(n) < c.g(n) for any c>0.
f is dominated by g asymptotically.
Little-omega (ω)
We say f(n) = ω(g(n)) iff f(n) > c.g(n) for any c>0.
g is dominated by f asymptotically.
Note the following relation between different n terms:
Last updated