Skip to content

DSA Visualizer

Sorting algorithms, step by step

Three simple sorts, the same array. Compare how many comparisons and swaps each one takes, and what a "pass" actually looks like.

Repeatedly swaps adjacent out-of-order pairs. Simple, rarely used in practice, but the clearest introduction to how a sort actually moves values.

Step 1 of 50

Starting array. Bubble sort repeatedly steps through the array, swapping adjacent elements that are out of order.