Advanced Data Structures & Algorithms
Q100 / 100

What is the randomized algorithm QuickSelect and its expected time complexity?

Correct! Well done.

Incorrect.

The correct answer is C) O(n) expected with O(n²) worst case

C

Correct Answer

O(n) expected with O(n²) worst case

Explanation

QuickSelect finds the k-th smallest element in O(n) expected time by partitioning like quicksort but recursing only on the relevant partition. Worst case O(n²) for adversarial pivots; Median-of-Medians gives O(n) worst case.

Progress
100/100