Arrange the following complexity of the algorithm in ascending order.
Arrange the following complexity of the algorithm in ascending order.
O(2ⁿ), O(n), O(log₂n), O(n log₂n), O(n²)
Show answerHide answer
Correct answer: (A) O(log₂n), O(n), O(n log₂n), O(n²), O(2ⁿ)
Explanation
For large n the growth order is log n < n < n log n < n² < 2ⁿ.