Question 73Asked in DSSSB PGT Computer Science (Technical), 11 Jul 2021

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²)
  1. AO(log₂n), O(n), O(n log₂n), O(n²), O(2ⁿ)
  2. BO(n), O(log₂n), O(n log₂n), O(n²), O(2ⁿ)
  3. CO(n), O(n²), O(log₂n), O(n log₂n), O(2ⁿ)
  4. DO(log₂n), O(n log₂n), O(n), O(n²), O(2ⁿ)
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ⁿ.

From DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021

This is question 73 of DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.