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.
Articles by others on the same topic
Comparison sort is a category of sorting algorithms that operate by comparing elements to one another to determine their order. This method relies on comparing pairs of elements and deciding their relative positions based on these comparisons. The most common characteristic of comparison sorts is that they can be implemented so that the sorted order depends solely on the way elements are compared.