n = length of array, repeat 0 TO n-1 times (pass = repeat through every element in array), all pairs of elements compared and swapped (each j increment represent index, moves onto next pair), largest element will bubble up to last, until j = n - i (number of passes) - 1. minus i means ignore swapping last element as its already sorted