🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Merge Sort and Quick Sort: all 13 questions

Quiz: Merge Sort and Quick Sort · Question 2 of 13

What is the worst-case time complexity of merge sort?

What is the worst-case time complexity of merge sort?

  1. A.O(n)
  2. B.O(n log n)
  3. C.O(n²)
  4. D.O(log n)
Answer & explanation

Correct answer: O(n log n)

Merge sort always splits evenly, so it has log n levels with O(n) work per level, whatever the input.

Can you get the rest right without peeking?

Take the timed Quiz: Merge Sort and Quick Sort quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →