Bubble Sort

do:
for each pair of adjacent elements:
if the values are out of order:
swap the values
while the array is not sorted

  1. Look at each adjacent pair in the array
  2. Swap adjacent pairs if they are out of order
  3. Repeat until no swaps are made

worst-case runtime of bubble sort O(n2). Each pass of the array is O(n), and up to n passes may be required. Multiply that together to get O(n2).