public int getKthLargest(int[] array, int k) { if (k < 1 || k > array.Length) { throw new ArgumentException(); } foreach (int item in array) { customHeaps.Insert(item); } for (int i = 0; i < k - 1; i++) { customHeaps.Remove(); } return(customHeaps.Max()); }
public int Dequeue() { return(customHeaps.Remove()); }