✏️ Explanatory Question
Reorder the following efficiencies from the smallest to the largest: (a) 2n (b) n! (c) n5 (d) 10,000 (e) n·log2(n)
Reorder the following efficiencies from the smallest to the largest: (a) 2n (b) n! (c) n5 (d) 10,000 (e) n·log2(n)
Ans. 10,000 < n·log2(n) < n5 < 2n < n!
💡 Explanation:
To arrange the expressions correctly, compare how quickly each one grows as n becomes very large.
Therefore, the correct order is: constant → log-linear → polynomial → exponential → factorial .
Memory tip: O(1) < O(n log n) < O(nk) < O(2n) < O(n!)