[M] [Math] Finding closest numbers to median.

0 views
Skip to first unread message

SURI

unread,
Jul 13, 2011, 9:13:21 AM7/13/11
to Freak-Your-Mind [FYM]
Given a set S of n distinct numbers and a positive integer k<=n.
Need a best way to find the k closest numbers to the median of S.

bhargava

unread,
Jul 23, 2011, 4:17:45 AM7/23/11
to freak...@googlegroups.com
If we say k closest numbers are k/2 to the left of median and k/2 to the right of median, then
a variation of quick-sort can be used to find the numbers.



Reply all
Reply to author
Forward
0 new messages