Arrange the following in the order of growth. O(n), O(n²), O(2ⁿ), O(log n), O(n log n), O(n² log n)
Arrange the following in the order of growth.
O(n), O(n²), O(2ⁿ), O(log n), O(n log n), O(n² log n)
Show answerHide answer
Correct answer: (C) O(log n), O(n), O(n log n), O(n²), O(n² log n), O(2ⁿ)
Explanation
Growth order: log n < n < n log n < n² < n² log n < 2ⁿ. Exponential growth is the fastest.