Bubble Sort
Bubble sort swaps adjacent items that are out of order and repeats until a pass makes no swaps.
Costs
| Category | Algorithm |
| Difficulty | Easy |
| Comparisons, worst and average | O(n²) |
| Best case, already sorted with an early stop | O(n) |
| Extra memory | O(1) |
Questions
What is Bubble Sort?
Bubble sort swaps adjacent items that are out of order and repeats until a pass makes no swaps.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.