These are three simple O(n²) comparison sorts. They are slow on large inputs but easy to understand and useful for teaching the mechanics of sorting.
How each works
- Bubble sort: repeatedly swap adjacent out-of-order pairs; large values "bubble" to the end each pass.
- find the minimum of the unsorted part and swap it into place.
