Bubble Sort
Bubble sort is based on the idea of repeatedly comparing pairs of adjacent elements and then swapping their positions if they exist in the wrong order.
In pseudo-code, this would look like:
counter <-- 0
swaps <-- 1
length <-- LEN(list)# this gives the number of elements in the array
WHILE swaps > 0
swaps <-- 0
FOR counter <-- 0 TO length-2 DO
IF list[counter] > list[counter+1] THEN
temp <-- list[counter]
list[counter] <--list[counter+1]
list[counter+1] <-- temp
swaps <-- swaps + 1
ENDIF
ENDFOR
ENDWHILE