why not form a tree with each node keeping count of elements smaller than it, i.e nodes in left subtree. so tree formation is O(n) and tree search is O(logn)
Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Mon, Jun 6, 2011 at 12:15 PM, the coder <coder.du...@gmail.com> wrote: > hi friendz > > given an array how to find the k th largest element in O(N) > complexity. > > -- > 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?hl=en. > > -- 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?hl=en.