Common

Quickselect

Algorithm for the kth smallest element in an array

Quickselect

Common card · No. 271168

In computer science, quickselect is a selection algorithm to find the kth smallest element in an unordered list, also known as the kth order statistic. Like the related quicksort sorting algorithm, it was developed by Tony Hoare, and thus is also known as Hoare's selection algorithm. Like quicksort, it is efficient in practice and has good average-case performance, but has poor worst-case performance. Quickselect and its variants are the selection algorithms most often used in efficient real-world implementations. Quickselect uses the same overall approach as quicksort, choosing one element as a pivot and partitioning the data in two based on the pivot, accordingly as less than or greater than the pivot. However, instead of recursing into both sides, as in quicksort, quickselect only recurses into one side – the side with the element it is searching for. This reduces the average complexity from O ( n log ⁡ n )...

Read on Wikipedia · Image Pashapanther, CC BY 3.0

Open boosters, collect cards and trade them. Free to play.

Play for free
Quickselect – Common Wikipedia card | Wikiverse TCG