@Prashant: Reading a book and getting the things discussed is sth different. In cormen some algorithms are randomised which in worst case may go upto O(n^2) for kth smallest or kth largest element find. So i was aking for a new answer.
On Mon, Aug 31, 2009 at 9:04 AM, Prashant<prashant.r.k...@gmail.com> wrote: > @ Nagendra Kumar > U can refer Cormen book; it is available... > > On Sun, Aug 30, 2009 at 8:06 AM, Dufus <rahul.dev.si...@gmail.com> wrote: >> >> Is it acceptable if I >> find the median in O(logn) time and then, >> find k numbers closest to the median in O(k) space and O(n) time? >> >> _dufus >> >> >> On Aug 30, 4:38 pm, Nagendra Kumar <nagendra....@gmail.com> wrote: >> > Given a set S of n distinct numbers and a positive integer k <= n. >> > Determine the k numbers in S that are closest to the median of S. >> > Find an O(n) algorithm >> >> > > > > -- > > Prashant Kulkarni > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---