Sorting algorithms/Cocktail sort: Difference between revisions

m
Line 2,397:
if swapped then
swapped~
for i=lenA2 to 0
if a(i) > a(i+1) then swap a(i), a(i+1): swapped = true
next
end if
until not swapped
Line 2,415:
if swapped then
swapped~
for i=lenA2 to 0
if a$(i) > a$(i+1) then
swap a$(i), a$(i+1)
swapped = true
end if
next
end if
until not swapped
404

edits