AlgoScope

Radix Sort

AlgorithmintermediateSorting

Counting-sort by each digit from least significant to most; stability makes it work.

Decision · step 10 of 33Counting and Radix Sort: Radix sort, ones then tens
0123456789incntout53891527184525000113456725

in[6] = 25, ones digit 5. count[5] drops to 3, and that is its slot: out[3] = 25.

Open in the player →or start at step 10

What you will see

One digit column is highlighted per pass; elements regroup by that digit.

How counting and radix sort works →

Cost

BestO(d(n + b))
AverageO(d(n + b))
WorstO(d(n + b))
SpaceO(n + b)

d digitsbase b.

Properties

  • × comparison based
  • ✓ stable
  • × in place
  • × adaptive
  • × online

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next, compare two runs.

Screen readers: Cells announce index, value and state (comparing, swapped, sorted); each step announces the comparison outcome and any move.

Reduced motion: Swaps become value crossfades with outline flashes; sorted-region growth is a static span change.

Before this

Variants

  • LSD Radix Sort Least significant digit first.
  • MSD Radix Sort Most significant digit first

Leads to

Topics that need this one first.

Taught by the same lesson

Counting and Radix Sort covers these too, in the same run.