Stable Sorting
Equal keys keep their original relative order.
Decision · step 2 of 5Stable Sorting: Selection sort flips it
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.
What you will see
Equal values carry a small tag; a stable sort keeps tag order, an unstable one may not.
Cost
| Space | O(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.