- Compares first 2 numbers in array. Will swap them if the number on the left is greater than the number on the right.
- Goes onto the next 2 numbers, does the same for the rest. Compare, check if larger and switch if needed.
- Now we know that the final number in the array is the largest.
- We repeat the process all again, slowly confirming that we have the largest number after swapping and reaching the end of the array.
FOR i FROM length-2 TO 0 STEP -1 DO
FOR counter FROM 0 TO i DO
IF list[counter ]>list[counter +1] THEN
SET temp TO list[counter +1]
SET list[counter +1] TO list[counter ]
SET list[counter] TO temp
END IF
END FOR
END FOR
