Sorting algorithms/Bubble sort: Difference between revisions

Content added Content deleted
m (Fixed lang tags.)
(Corrected Actionscript implementation.)
Line 23: Line 23:
while (!changed)
while (!changed)
{
{
sorted = true;
changed = true;
for (var i:int = 0; i < toSort.length - 1; i++)
for (var i:int = 0; i < toSort.length - 1; i++)
Line 33: Line 33:
toSort[i + 1] = tmp;
toSort[i + 1] = tmp;
sorted = true;
changed = false;
}
}
}
}