AlgoScope

Stable Sorting

AnalysisbeginnerAlgorithm Properties

Equal keys keep their original relative order.

Decision · step 2 of 5Stable Sorting: Selection sort flips it
10315253ij

Pass 0: the smallest of the rest is 1 at index 3. Swap it into index 0. The 5 that sat there jumps to index 3, past everything in between. That carried a tagged 5 past its twin: the order flipped.

Open in the player →or start at step 2

What you will see

Equal values carry a small tag; a stable sort keeps tag order, an unstable one may not.

How stable sorting works →

Cost

SpaceO(1)

How you work with it here

play it through, compare two runs.

Screen readers: Growth curves are described in words and as a table of operation counts for sample input sizes; each concept has a one-sentence spoken definition.

Reduced motion: Curves and counters update without animation.

Before this