By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,903 Members | 1,132 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,903 IT Pros & Developers. It's quick & easy.

problem on medians

P: n/a
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!

Ajinkya

May 31 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ajinkya wrote:
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!
Nor is it a C one!

Try somewhere like comp.programming.

--
Ian Collins.
May 31 '07 #2

P: n/a

Ian Collins wrote:
Ajinkya wrote:
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!
Nor is it a C one!
sorry!
>
Try somewhere like comp.programming.
Ok. thanks.
>
--
Ian Collins.
May 31 '07 #3

P: n/a

"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
May 31 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.