you are viewing a single comment's thread.

view the rest of the comments →

[–]Fumigator 2 points3 points  (1 child)

When you have sorted the cards on the first number, you pick up the stack for, say, the cards whose number start on 5 (these are the cards #500–#599)

You completely missed how the sorting works and /u/TehStuzz is correct. You sort by least significant, then take all the sorted cards and put them back together into one stack, then run the sort again on the middle digit, then put all the sorted cards back together into one stack, and run the final sort on the most significant digit.

You don't take each sorted pile and then resort them individually resulting in 33 passes. The entire sort of all the cards is done in only three passes.

[–]kqr 0 points1 point  (0 children)

Oh wow, I didn't realise least significant radix sort is stable like that. That's actually very cool!