Radix Sort Visualizer
See Radix Sort process values by digit positions with animated buckets, playback controls, operation metrics, and clear explanations.
Comma-separated numbers, up to 20 values.
Live operation
bucket
Digit buckets (base 10)
digit place: 10
1
2
3
4
5
6
7
8
9
Comparisons
0
Moves / writes
0
Confirmed sorted
0 / 7
Algorithm notes
What to watch for
LSD Radix Sort starts with the ones digit and works leftward. Stability is the key: a later digit pass preserves the order established by earlier digits.
Concept guide
Review the mental model, tradeoffs, and practical use cases after you experiment.
Radix Sort Complete Info Card
Radix Sort is a digit-by-digit sorting algorithm that processes individual digits using a stable sort (typically Counting Sort). Efficient for numbers and fixed-length strings, it avoids direct element comparisons.
Algorithm Characteristics
Time Complexity (Best)
Fixed number of digits
Time Complexity (Average)
Uniform key distribution
Time Complexity (Worst)
All elements have same digit length
Space Complexity
Auxiliary counting sort needed
Stable
Depends on base sort stability
In-Place
Requires additional memory
Sorting Process Steps
Find maximum number to determine digit count
Sort least significant digit (LSD) using stable sort
Move to next significant digit
Repeat until all digits processed
Final array is sorted
Variants & Methods
| Variant | Advantages | Challenges |
|---|---|---|
| LSD (Least Significant) | Simpler implementation | Processes all digits equally |
| MSD (Most Significant) | Can stop early | More complex implementation |
| In-Memory | Better cache usage | Limited by memory |
| Fixed-Length Keys | Optimal performance | Requires padding |
| Hybrid (MSD/LSD) | Balanced approach | Implementation complexity |
Optimal Use Cases
- •Sorting large sets of integers
- •Fixed-length string sorting
- •When data has multiple digits/characters
When to Avoid
- •Floating-point numbers
- •Variable-length data with large variance
- •Small datasets with wide value ranges