Bubble Sort
Info
This is live visualisation of a bubble sort algorithm. It begins with a random set of elements and sorts them smallest to largest, visualising each step of the sort.
Bubble sorts are not the most efficient of sort algorithms but they are easy to implement. You just loop through the list and swap two that are in the wrong order until no more are swapped.
Sort speed is delayed to show it working.
- Red means a value was swapped
- Blue is no swap
- Green is the next element compared with the current red or blue.
use the slider to increase the number of elements to sort, the speed will automatically increase over 60 items.