array/Kth Largest Element in Array/java/solution.java
int extractMin()
    {
      if (heap_size == 0)
        return Integer.MAX_VALUE;

      // Store the maximum vakue.
      int root = harr[0];


      if (heap_size > 1)
      {
        harr[0] = harr[heap_size - 1];
        minHeapify(0);
      }
      heap_size--;
      return root;
    }
// Method to remove maximum element (or root) from min heap
Method to remove maximum element (or root) from min heap
Method to remove maximum element ( or root ) from min heap
int extractMin()
    {
      if (heap_size == 0)
        return Integer.MAX_VALUE;
      int root = harr[0];
      if (heap_size > 1)
      {
        harr[0] = harr[heap_size - 1];
        minHeapify(0);
      }
      heap_size--;
      return root;
    }
int extractMin ( ) { if ( heap_size == 0 ) return Integer . MAX_VALUE ; int root = harr [ 0 ] ; if ( heap_size > 1 ) { harr [ 0 ] = harr [ heap_size - 1 ] ; minHeapify ( 0 ) ; } heap_size -- ; return root ; }
Method to remove maximum element (or root) from min heap
Method to remove maximum element ( or root ) from min heap
// Store the maximum vakue.