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

You need the 3rd smallest of 10⁶ numbers, as fast as possible on average. Which idea fits?

You need the 3rd smallest of 10⁶ numbers, as fast as possible on average. Which idea fits?

  1. A.Merge the array with itself
  2. B.Quickselect: partition, then continue only on the side containing index 2
  3. C.Bubble sort three passes, then read the start
  4. D.Insertion sort the whole array
Answer & explanation

Correct answer: Quickselect: partition, then continue only on the side containing index 2

Quickselect reuses the partition step but recurses into one side only, giving 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 →