Radix sort: Sort digit by digit using stable counting sort.
Find max to know digit count.
For each digit position, counting sort on that digit.
Example :
- Ones:
- Tens:
- Hundreds:
Each pass stable, preserving earlier order when equal.
Sort digit by digit, from least to most substantial.
Radix sort: Sort digit by digit using stable counting sort.
Find max to know digit count.
For each digit position, counting sort on that digit.
Example :
Each pass stable, preserving earlier order when equal.