why evaryone is thinking about heap...we can use selection algorithm and find the n-k smallest element in that. this will take O(n) time
On Sep 10, 1:23 pm, Kunal Patil <[email protected]> wrote: > @Dave: TC in your first case will be O(klogn + n). > Transforming array into heap would be O(n). > Correct me If i am wrong. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
