Bubble sort
variables
Numbers is array of integer of length 1 to 5
x,y, temporary of type integers
Check type of boolean
begin
check <== True
while x <= 5 and check = True do
while y <= 5 do
if Numbers[y<Numbers[y+1]
then Check <== Flase
Else
temporary <== Numbers[y+1]
Numbers[y+1] <== Number[y]
Numbers[y] <== Temporary
End of IF
Increment y
End of y While loop
Increment x
End of x while loop
the reason I used check boolean variable is to make the algorithm efficient because if a sort does not happen then the number being checked is already sorted so it needs to step out of the loop