429 448 386 442 628 391 148 381 671 484
In the first phase, we enqueue each datum on a queue named by its last digit. This gives:
0: | |||||||
1: | 391 | 381 | 671 | ||||
2: | 442 | ||||||
3: | |||||||
4: | 484 | ||||||
5: | |||||||
6: | 386 | ||||||
7: | |||||||
8: | 448 | 628 | 148 | ||||
9: | 429 |
391 381 671 442 484 386 448 628 148 429
Now, we repeat by queuing according to the middle digit:
0: | |||||||
1: | |||||||
2: | 628 | 429 | |||||
3: | |||||||
4: | 442 | 448 | 148 | ||||
5: | |||||||
6: | |||||||
7: | 671 | ||||||
8: | 381 | 484 | 386 | ||||
9: | 391 |
628 429 442 448 148 671 381 484 386 391
Again, we enqueue the data, this time on the first digit:
0: | |||||||||
1: | 148 | ||||||||
2: | |||||||||
3: | 381 | 386 | 391 | ||||||
4: | 429 | 442 | 448 | 484 | |||||
5: | |||||||||
6: | 628 | 671 | |||||||
7: | |||||||||
8: | |||||||||
9: |
148 381 386 391 429 442 448 484 628 671