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 such that f(n) <= c.g(n) for all n >=
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 such that f(n) >= c.g(n) for all n >=
g(n) will be the lower-bound for f(n).
Big-Theta ()
We say f(n) = (g(n)) iff there exist some constants c and c, and such that c.g(n) <= f(n) <= c.g(n) for all n >=
g(n) will be both the upper and lower bound for f(n), for certain constants c and c.
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