42
0
17
1
88
2
33
3
71
4
9
5
56
6
25
7
64
8
12
9
AlgoPlus//sorting / radix sort
Read the theory

Radix Sort · Digit by Digit

Stable counting passes from least to most significant digit.

Stability
Stable
In-Place
No
Space Complexity
O(n+k)
Avg Time
O(nk)
Size10
Legend
Comparing
Swapping / moving
Tracked (min / key)
Pivot
Sorted / found
Out of focus
AI Tutor Workspace
In a nutshell
Radix sort orders numbers one digit at a time, starting from the rightmost (least-significant) digit and working left. Each pass is a stable bucketing by a single digit, which keeps the order from previous passes intact. After processing the most-significant digit the whole list is sorted — all without ever comparing two numbers directly.
Ready
Press play to begin the cinematic walkthrough.
Sort by one digit at a time, starting from the least-significant, using a stable count on each pass. Ties keep their order, so earlier passes survive and after the last digit everything is sorted.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Radix Sort · Digit by Digit.