🧮Bubble Sort
Also known as Sinking Sort
A simple sort that swaps neighbours until the list is in order. It is slow.
Think of it like
Think of it like bubbles in a glass. The biggest ones float up to the top, one at a time.
Example
Jack's class sorts five cards with bubble sort by hand. It takes four passes, and the 9 moves one place right each time.
Why it matters
It is the first sort most people learn. It shows why speed matters.
Definition
Common mistake
Key takeaways
- 1Swap neighbours. When out of order.
- 2Pass after pass. Until no swaps.
- 3O(n²). For teaching, not work.