"Ajinkya" <ka*********@gmail.comwrote in message
news:11*********************@i38g2000prf.googlegro ups.com...
What are the least no. of comparisons required to find the median of a
set of n integers ?
Which is the best algorithm for this?
PS: not a homework question!
If it is not homework then copy the numbers to a temporary array, sort them
with qsort(), and take the middle.
There might be a cleverer way of doing it, but it is pointless in a
practical app.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm