← 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?
- A.Merge the array with itself
- B.Quickselect: partition, then continue only on the side containing index 2
- C.Bubble sort three passes, then read the start
- 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 →