🎙 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 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?

  1. A.O(n²)
  2. B.O(n)
  3. C.O(n log n)
  4. 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 →