Common · Knowledge
Quickselect
Selection algorithm to find the kth smallest element in an unordered list
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.
From Wikipedia
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 ) {\displaystyle O(n\log n)} to O ( n ) {\displaystyle O(n)} , with a worst case of O ( n 2 ) {\displaystyle O(n^{2})} . As with quicksort, quickselect is generally implemented as an in-place algorithm, and beyond selecting the kth element, it also partially sorts the data. See selection algorithm for further discussion of the connection with sorting.
Text: Wikipédia, CC BY-SA 4.0. · Image: Pashapanther (CC BY 3.0) ·
Related cards
-
★★★
A* search algorithm
Algorithm used for pathfinding and graph traversal
-
★★★
Newton's method
Algorithm for finding a zero of a function
-
V★★
Viterbi algorithm
Algorithm
-
S★
Simplified Cangjie
Chinese input method
-
C★★
CJK Unified Ideographs (YES order)
Method for ordering Han characters
-
★
Gibbs sampling
Algorithm
-
★★
Floyd–Warshall algorithm
Algorithm for finding all-pairs shortest paths in graphs, allowing some edge weights to be negative
-
★★★
Euclidean algorithm
Algorithm for computing greatest common divisors
-
★
Arithmetical hierarchy
Hierarchy which classifies certain sets based on the complexity of formulas that define them
-
★★
Maze-solving algorithm
Automated method for solving mazes
-
★
Youden's J statistic
Index that describes the performance of a dichotomous diagnostic test
-
★★★
Fisher–Yates shuffle
Algorithm for generating a random permutation of a finite set
-
★★
Binary search tree
Data structure in tree form with 0, 1, or 2 children per node, sorted for fast lookup
-
★★★
Kolmogorov complexity
Measure of algorithmic complexity
-
★
Tarjan's strongly connected components algorithm
Graph theory algorithm
-
K★
Kosaraju's algorithm
Algorithm to find the strongly connected component of a directed graph
-
B★
Buddy memory allocation
Memory allocation algorithm
-
★★★
Binary search
Search algorithm in sorted lists that operates by decreasing the search space by half each pass