Answer:
procedure bubbleSort( A : list of sortable items ) defined as:
do
swapped := false
for each i in 0 to length(A) - 1 inclusive do:
if A[i] > A[i+1] then
swap( A[i], A[i+1] )
swapped := true
end if
end for
while swapped
end procedure
First answer by Vafloyd. Last edit by Vafloyd. Contributor trust: 79 [recommend contributor recommended]. Question popularity: 1 [recommend question].