Content deleted Content added
m Added time complexity for the described algorithm. Also corrected bad use of complexity notation( O(n) is the standard, not "n" ). Quicksort and Quicksearch are names of algorhtms, should start with capital. |
|||
Line 37:
{{see|Quickselect}}
Linear performance can be achieved by a partition-based selection algorithm, most basically [[quickselect]]. Quickselect is a variant of [[quicksort]] – in both one chooses a pivot and then partitions the data by it, but while
The partition-based algorithms are generally done in place, which thus results in partially sorting the data. They can be done out of place, not changing the original data, at the cost of
=== Median selection as pivot strategy ===
{{see|Median of medians}}
A median-selection algorithm can be used to yield a general selection algorithm or sorting algorithm, by applying it as the pivot strategy in
In detail, given a median-selection algorithm, one can use it as a pivot strategy in
Similarly, given a median-selection algorithm or general selection algorithm applied to find the median, one can use it as a pivot strategy in
== Incremental sorting by selection ==
|