Notation
Big O ()
It is defined as upper bound, is used to describe asymptotic upper bound. Mathematically, if f(n) describes the running time of an algorithm; is if there exist positive constant and such that, for all
Big Omega ()
It is define as lower bound and lower bound on an algorithm is the least amount of time required ( the most efficient way possible, in other words best case).
Just like O notation provide an asymptotic upper bound, Ω notation provides asymptotic lower bound. **
Let f(n) define running time of an algorithm;
f(n) is said to be Ω(g (n)) if there exists positive constant C and (n0) such that
Big Theta ()
It is define as tightest bound and tightest bound is the best of all the worst case times that the algorithm can take.
Let f(n) define running time of an algorithm.
f(n) is said to be Θ(g(n)) if f(n) is O(g(n)) and f(n) is Ω(g(n)).
Mathematically,
Merging both the equation, we get :
The equation simply means there exist positive constants C1 and C2 such that f(n) is sandwich between C2 g(n) and C1 g(n).
Master Theorem
is constant, is additional function, is a recursive function that , then we have:
- when (which is actually same as )
- when .
- when (which is actually same as ), and have enough large and constant for
- when
