Radix Sort
Distribute values by one digit at a time and collect buckets stably from least to most significant digit.
Core idea
Process digits from least to most significant. Each stable bucket pass orders values by one more digit while preserving the order established by all lower digits.
Read the visualization
The active place value selects one of ten buckets for every number. Collection drains buckets from zero through nine without changing order inside a bucket.
Begin a stable bucket pass for the next base-ten digit.
Complexity and tradeoffs
Time: O(d(n+k)). Space: O(n+k). Avoids comparisons when keys have d bounded digits over radix k; every digit pass must be stable.
Where it fits
Radix Sort is effective for bounded integers, fixed-width identifiers, and strings with a controlled alphabet. Extra storage and multiple full passes make it unsuitable for arbitrary comparison keys.