🫧 Bubble Sort Invariant

Bubble the largest element to the end, repeat

Click "Next Step" to begin sorting.
Pass: 0 | Comparisons: 0 | Swaps: 0
Sorted (bubbled)
Comparing
Swapping
Unsorted
📐 Loop Invariant (Outer): After pass i, the largest i elements are in their final sorted positions at the end of the array.
✓ Initial: No passes completed yet.