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?
sort 4 elements with 3 comparisons (not a homework question)
Started by Mihail121, Jan 17 2009 03:55 PM
2 replies to this topic
#1
Posted 17 January 2009 - 03:55 PM
#2
Posted 17 January 2009 - 06:43 PM
It's not possible. The minimum number of compare and swap-operations you need is five (assuming the data is not already partly sorted).
My music: http://myspace.com/planetarchh <-- my music
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
#3
Posted 17 January 2009 - 08:46 PM
Depends on how you define measurements. spaghetti sort could definitely do it.. =)
http://iki.fi/sol - my schtuphh
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












