Remix.run Logo
ekelsen 2 days ago

Wouldn't it make sense to test radix sort? You could do it in one pass with 2 bits and it would degrade gracefully as the number of bits increased. A MSB bucketing followed by LSB passes would take care of the 5% random data case with good efficiency.

Voultapher a day ago | parent [-]

radsort a radix sort is present in the comparison results.

ekelsen a day ago | parent [-]

hmmm, the performance suggests it's not a particularly good implementation of one. (performance at sizes that fit in the cache being lower than performance that exceed it...)

Also the statement in the text is just false ("Radsort is a radix sort and as such unable to adapt to patterns in the data")

MSB absolutely can adjust quite easily. Even LSB can pay some attention. And hybrid like I suggested (use MSB to bucket based on high bits and then LSB) absolutely can...

Voultapher 21 hours ago | parent [-]

You are right, a better wording be a "is a pure radix sort".