Data structures · Sorting

Selection sort

When moving an item is expensive, a sort that swaps once per pass can beat one that swaps on every comparison.