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…
- A.
O(n), O(n2), O(n log n), O(log n)
- B.
O(log n), O(n), O(n log n), O(n2)
- C.
O(n2), O(n log n), O(n), O(log n)
- 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.
Loading lesson…