The LSD radix sort can logically combine the sorted bins after each pass (count them as one bunker if counting / radix sorting is used). The MSD radix variety must recursively sort each bit independently after each pass. If sorted by bytes, 256 bins after the first pass, 65536 boxes after the second pass, 16777216 (16 million) boxes after the third pass, ....
LSD. . . "0" "9", "0", 1 () , - .., "" . , , , , .
http://www.youtube.com/watch?v=jJH2alRcx4M
++ LSD radix sort 32- , "" . , , . .
uint32_t * RadixSort(uint32_t * a, uint32_t *b, size_t count)
{
size_t mIndex[4][256] = {0};
size_t i,j,m,n;
uint32_t u;
for(i = 0; i < count; i++){
u = a[i];
for(j = 0; j < 4; j++){
mIndex[j][(size_t)(u & 0xff)]++;
u >>= 8;
}
}
for(j = 0; j < 4; j++){
m = 0;
for(i = 0; i < 256; i++){
n = mIndex[j][i];
mIndex[j][i] = m;
m += n;
}
}
for(j = 0; j < 4; j++){
for(i = 0; i < count; i++){
u = a[i];
m = (size_t)(u>>(j<<3))&0xff;
b[mIndex[j][m]++] = u;
}
std::swap(a, b);
}
return(a);
}