Jump to content

Selection sort

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Conversion script (talk | contribs) at 15:51, 25 February 2002 (Automated conversion). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Selection sort is a family of sort algorithms that works as follows:

  • remove the lowest datum one at a time until the set of data is empty

The naive algorithm, iterating through the list of unsorted data, has O(N2) performance. Heapsort optimizes the algorithm by using a heap data structure to speed finding and removing the lowest datum.