A simple, but not very efficient, algorithm for arranging a set of n numbers in order of magnitude. The method starts with the left-hand pair of numbers, swapping them if necessary. The second and third numbers are now considered. If they are swapped then the first pair are reconsidered. Next the third and fourth numbers are considered. If swapped then previous pairs are again reconsidered, working from right to left. As with the bubble sort, ½n(n−1) comparisons may be required.