Which of the following is the correct ascending order of complexity in terms…

Which of the following is the correct ascending order of complexity in terms of growth rate?

Answer: B. O(log n), O(n), O(n log n), O(n2)The correct ascending order of time complexity growth rates is O(log n) < O(n) < O(n log n) < O(n²). Logarithmic complexity grows slower than linear, which is…

  1. A.

    O(n), O(n2), O(n log n), O(log n)

  2. B.

    O(log n), O(n), O(n log n), O(n2)

  3. C.

    O(n2), O(n log n), O(n), O(log n)

  4. D.

    O(log n), O(n2), O(n log n), O(n)

Attempted by 296 students.

Show answer & explanation

Correct answer: B

The correct ascending order of time complexity growth rates is O(log n) < O(n) < O(n log n) < O(n²). Logarithmic complexity grows slower than linear, which is slower than n log n, and finally quadratic complexity.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…