Bubble sort
Swap neighbours that are out of order until a pass makes no change.
Values5, 1, 4, 2, 8, 3
Start with the array 5, 1, 4, 2, 8, 3.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub
Swap neighbours that are out of order until a pass makes no change.
Values5, 1, 4, 2, 8, 3
Start with the array 5, 1, 4, 2, 8, 3.
Space play · ← → step · Home End jump · drag the strip to scrub