Time complexity for finding k largest elements in array of length n(optimally) is: ?
A) O(n+ klogk)
B) O(k + nlogk)
C) O(K+ (n-k)logk)
D) None of the above.
Answer & Solution
Answer: Option ASolution:
O(n+ klogk)