array/Kth Largest Element in Array/java/solution.java
int kthSmallest(int arr[], int n, int k)
  {

    // Build a heap of first k elements: O(k) time
    MinHeap mh = new MinHeap(arr, n);


    for (int i = 0; i < k - 1; i++)
      mh.extractMin();

    // Return root
    return mh.getMin();
  }
// Function to return k'th largest element in a given array
Function to return k'th largest element in a given array
Function to return k ' th largest element in a given array
int kthSmallest(int arr[], int n, int k)
  {
    MinHeap mh = new MinHeap(arr, n);
    for (int i = 0; i < k - 1; i++)
      mh.extractMin();
    return mh.getMin();
  }
int kthSmallest ( int arr [ ] , int n , int k ) { MinHeap mh = new MinHeap ( arr , n ) ; for ( int i = 0 ; i < k - 1 ; i ++ ) mh . extractMin ( ) ; return mh . getMin ( ) ; }
Function to return k'th largest element in a given array
Function to return k ' th largest element in a given array
// Build a heap of first k elements: O(k) time // Return root