Comparison sort (source code)

= Comparison sort
{wiki}

= Comparison-based sorting
{synonym}

A <comparison sort> learns the ordering of <sort keys> only by comparing pairs. The keys are otherwise opaque: their numeric values, digits or encodings cannot choose an <array> index or a branch. It may move complete <sorting records> and retain previous answers. <Merge sort> and the adjacent-swap <insertion sort> are <comparison sorts>; <counting sort> and <radix sort> exploit additional information.