There is a whole range of sorting techniques, of varying levels of efficiency and sophistication. This section introduces a small selection of the sorts available.
For convenience it is assumed that arrays of integers are to be sorted, but the techniques can be equally well used with arrays of other types, including arrays of structures.
The sorts here sort into ascending order, but sorting can also be performed into descending order by changing the way items are tested – the principles remain the same.
Next: Bubble Sort