Jump to content

Stable 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.

A stable sort is a sorting algorithm that does not change the relative order of elements that have equal key values. This is important for some algorithms (for example, radix sort).

Some common stable sorts are:

Many other sorting algorithms can be specially implemented to be stable sorts. One way of doing this is to artificially extend the key comparison, such that comparisons between two objects with otherwise equal keys are decided using the order of the entries in the original data order as a tie-breaker.