Algorithms – Arrange Growth Rates in Increasing Order

algorithmsasymptotics

I want to Arrange the following growth rates in increasing order

This order are following : $O (n (\log n)^2), O ((35)^n), O(35n^2 + 11), O(1), O(n \log n)$

Please give me idea how to arrange growth rates in increasing order

Regards,
Jatin

Best Answer

When you are talking about big O notation, you should discard the constants, which means that $O(35n^2+11)$ should be written as $O(n^2)$.

what you are interested in is the size at big numbers. And here is a rule to remember:

$$O(n^n)>O(n!)>O(\alpha^n)>O(n^\alpha)>O(log(n))>O(1)$$

Where $\alpha$ is a constant.

If you are not sure, then you can just insert a big $n$ and check which is the biggest ($n=100$):

  • $35^{100} = 2.5\cdot10^{154}$

  • $100^2 = 10^{4}$

  • $100{\cdot}log^2(100)=400$

  • $100{\cdot}log(100)=200$

  • $1 = 1$ for every $n$

Showing you that $O(35^n) > O(n^2) > O(nlog^2(n))>O(nlog(n))>O(1)$

Related Question