## Radix sort:

- Assumption: input has d digits ranging from 0 to k
- Basic idea:
- Sort elements by digit starting with least significant
- Use a stable sort (like counting sort) for each stage

- Each pass over n numbers with d digits takes time O(n+k), so total time O(dn+dk)
- When d is constant and k=O(n), takes O(n) time

- Fast! Stable! Simple!
- Doesn’t sort in place

Previous slide | Next slide | Back to first slide | View graphic version |