START
DECLARATIONS
num [] list = [12, 6, 89, 2, 45]
num temp
IF list[0] != 2 AND list[4] != 89 THEN //First check if the list is already sorted, if not
then procced
FOR num B = 0, B > =4, B++ //Run the check through the entire list
IF list[B + 1] < list[B] THEN // Check if the elements need to be
switched
temp = list[B + 1] //Hold the second element temporarily
list[B+1] = list[B] //Switch the first element into the second
position
list[B] = temp //Set the first position to the second element
ENDIF
ENDFOR
ENDIF
END