Walk through the array comparing each pair of neighbours, swapping any pair that is out of order. After one pass the largest value has "bubbled" to the end. Repeat on the shrinking unsorted part.
Walk through the array comparing each pair of neighbours, swapping any pair that is out of order. After one pass the largest value has "bubbled" to the end. Repeat on the shrinking unsorted part.