Concept of Big-Oh, Omega, Theta in Algorithm Time complexity Calculation

In the Algorithm,
 when the total running time <= 2n, then we can say the time compexcity of O(2n) , which is O(n)

 when the total running time <= n2, then we can say the time compexcity of O(n2) , which is O(n2)

 when the total running time >= 2n, then we can say the time compexcity of w(2n) , which is w(n)

When the minimum number of loop or time compexity is equal to maximum time compexity then we can say Theta
For example of Bubble Sort Algorithm,  Base case is also O(n2) and Worst case is also O(n2), in this we can say time compexity Theta(n2), because it is same in every case.


Comments