← 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?
- A.O(n)
- B.O(n log n)
- C.O(n²)
- 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 →