Comments by "Winnetou17" (@Winnetou17) on "Why is Radix Sort so Fast? Part 2 Radix Sort" video.
-
10:41: "We've got the input list just here... same elements as before, I think..." "Well, you wrote it, mate!"
=)) What's a Creel playing both the teacher and the student for our amusement.
Question: for integers, if you know you're big-endian, isn't it easier to simply build the counter array to have power-of-two buckets (like 8 or 16) ? And then, instead of doing mod 10, simply read the relevant 3-4 bits, put in the relevant bucket, and so on. You also have to make sure to have the sign bit in it's own step. Also, would it help to construct all the count arrays at once, so you only traverse forward the array once ? It uses a bit more memory, but arrays of 16 integers... doesn't sound that bad. Worst case for normal integers would be to compare 64 bit signed integers, and that would amount to 64/4 + 1 = 17 count arrays (the extra one is for the sign count array).
Cheers!
30
-
1
-
1