Sorting algorithms/Bubble sort: Difference between revisions

(Corrected Actionscript implementation.)
Line 682:
}.do_while {!sorted};
);</lang>
 
=={{header|Lua}}==
 
<lang Lua>
function bubbleSort(A)
itemCount=#A
repeat
hasChanged = false
itemCount=itemCount - 1
for i = 1, itemCount do
if A[i] > A[i + 1] then
A[i], A[i + 1] = A[i + 1], A[i]
hasChanged = true
end
end
until hasChanged == false
end
</lang>
 
=={{header|Lucid}}==
Anonymous user