Sorting easy time O(n²) space O(1)
Bubble Sort
Repeatedly compare neighbours and swap them if out of order. Each pass carries the largest remaining value to its final place at the right end.
Bubble the largest remaining value to the right on every pass.
1 / 29
Practice
Machine twin: /dsa-viz-v2/bubble-sort.json — the full deterministic run as structured data.