🎙 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 13 of 13

What does quickselect do differently from quick sort?

What does quickselect do differently from quick sort?

  1. A.It sorts both sides after partitioning
  2. B.It uses merging instead of partitioning
  3. C.It always takes O(n log n)
  4. D.After partitioning, it continues only into the side that contains the k-th position
Answer & explanation

Correct answer: After partitioning, it continues only into the side that contains the k-th position

Skipping the other side is why it finds the k-th smallest in O(n) on average.

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 →