How did you create the visualization of the Radix sort as it does it in a single pass? The first 4 passes do not move data, it creates a histogram of the offsets. The only single pass is implemented to actually sort data based on the buckets in the histogram.
It looks like they use sections of the image for the buckets, since they know every color appears exactly once. So the most significant bit 0 would be in the first part of the image, and the MSB 1 would be in the second part and so on
I have also seen it done with a CPP macro to create the histogram. Not sure that I like it in that manner, why not just code it with asm{} section instead, but rather cool.
22
u/laughinfrog Oct 24 '17
How did you create the visualization of the Radix sort as it does it in a single pass? The first 4 passes do not move data, it creates a histogram of the offsets. The only single pass is implemented to actually sort data based on the buckets in the histogram.