Find the Kth largest number in an array.
Anonimo
Create a min heap of size k. Iterate down the list. If element is larger than the min number in min heap, replace the min heap's min element with it. Time complexity is O(k log k + n + n log k) worse case. Space complexity is O(n+k)