Bubble Sort
Search for adjacent pairs that are out of order.
Switch the out-of-order keys.
Repeat this n-1 times.
After the first iteration, the last key is guaranteed to be the largest.
If no switches are done in an iteration, we can stop.
Previous slide
Next slide
Back to first slide
View graphic version