AI engineering glossary · Data structures algorithms
What is quickselect?
Quickselect: An algorithm that finds the k-th smallest item of an unsorted array by partitioning around a pivot as in quicksort but continuing into only the side containing the target. It averages O(n) time.
Quickselect: an example
To find the median of 1 lakh values, partition around a pivot and recurse into only the half that holds the middle position.
Related terms
More Data structures algorithms terms
- Quicksort
- Radix sort
- Randomized algorithm
- Recurrence relation
- Recursion
- Red-black tree
- Reservoir sampling
- Segment tree
Where you learn it
Quickselect is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.