material/Beiträge/DDI-Vortrag 2/Source/sources/bubblesort.pseudo

9 lines
217 B
Text
Raw Permalink Normal View History

function bubblesort (A : list[1..n])
for i from n downto 1
for j from 1 to i-1
if (A[j] > A[j+1]) then
swap(A[j], A[j+1])
end if
next
next
end function