← Quiz: Merge Sort and Quick Sort: all 13 questions
Quiz: Merge Sort and Quick Sort · Question 12 of 13
What is the average-case time of quick sort with a random pivot?
What is the average-case time of quick sort with a random pivot?
- A.O(n²)
- B.O(n)
- C.O(n log n)
- D.O(log n)
Answer & explanation
Correct answer: O(n log n)
A random pivot splits the array reasonably evenly on average, giving about log n levels of O(n) partitioning.
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 →