math & physics
mihail121 at January 17th, 2009 10:55 — #1
Now I've had a friend over telling me one could sort 4 elements (balls for ex.) using 3 measurments with a standard scale. I tried and tried and TRIED but I just can't do it. Does anyone have an idea how would it be possible?
nils_pipenbrinck at January 17th, 2009 13:43 — #2
It's not possible. The minimum number of compare and swap-operations you need is five (assuming the data is not already partly sorted).
sol_hsa at January 17th, 2009 15:46 — #3
Depends on how you define measurements. spaghetti sort could definitely do it.. =)