Partial sorting: Difference between revisions

Content deleted Content added
Chmarkine (talk | contribs)
m Language/library support: change to https if the server sends HSTS header, replaced: http://docs.python.org → https://docs.python.org (2) using AWB
Line 23:
partial_quicksort(A, p+1, j, k)
 
The resulting algorithm is called partial quicksort and requires an ''expected'' time of only {{math|''O''(''n'' + ''k'' log ''k'')}}, and is quite efficient in practice, especially if we substitutea [[selection sort]] is used as a base case when {{mvar|k}} becomes small relative to {{mvar|n}}. However, the worst-case time complexity is still very bad, in the case of a bad pivot selection. Pivot selection along the lines of the worst-case linear time selection algorithm could be used to get better worst-case performance.
 
==Tournament algorithm==