title: Remove any element from fixed-size array based MinHeap data structure
body: <p>I am using <code>array based MinHeap</code> in java. I am trying to create a custom method which can remove any element not only <code>root</code> from the heap but couldn't. Below is <code>MinHeap</code> code-</p>
  
  <pre><code>public class MinHeap {
  
      /** Fixed-size array based heap representation */
      private int[] h;
      /** Number of nodes in the heap (h) */
      private int n = 0;
  
      /** Constructs a heap of specified size */
      public MinHeap(final int size) {
          h = new int[size];
      }
  
      /** Returns (without removing) the smallest (min) element from the heap. */
      public int peek() {
          if (isEmpty()) {
              throw new RuntimeException("Heap is empty!");
          }
  
          return h[0];
      }
  
      /** Removes and returns the smallest (min) element from the heap. */
      public int poll() {
          if (isEmpty()) {
              throw new RuntimeException("Heap is empty!");
          }
  
          final int min = h[0];
          h[0] = h[n - 1];
          if (--n &gt; 0)
              siftDown(0);
          return min;
      }
  
      /** Checks if the heap is empty. */
      public boolean isEmpty() {
          return n == 0;
      }
  
      /** Adds a new element to the heap and sifts up/down accordingly. */
      public void add(final int value) {
          if (n == h.length) {
              throw new RuntimeException("Heap is full!");
          }
  
          h[n] = value;
          siftUp(n);
          n++;
      }
  
      /**
       * Sift up to make sure the heap property is not broken. This method is used
       * when a new element is added to the heap and we need to make sure that it
       * is at the right spot.
       */
      private void siftUp(final int index) {
          if (index &gt; 0) {
              final int parent = (index - 1) / 2;
              if (h[parent] &gt; h[index]) {
                  swap(parent, index);
                  siftUp(parent);
              }
          }
      }
  
      /**
       * Sift down to make sure that the heap property is not broken This method
       * is used when removing the min element, and we need to make sure that the
       * replacing element is at the right spot.
       */
      private void siftDown(int index) {
  
          final int leftChild = 2 * index + 1;
          final int rightChild = 2 * index + 2;
  
          // Check if the children are outside the h bounds.
          if (rightChild &gt;= n &amp;&amp; leftChild &gt;= n)
              return;
  
          // Determine the smallest child out of the left and right children.
          final int smallestChild = h[rightChild] &gt; h[leftChild] ? leftChild
                  : rightChild;
  
          if (h[index] &gt; h[smallestChild]) {
              swap(smallestChild, index);
              siftDown(smallestChild);
          }
      }
  
      /** Helper method for swapping h elements */
      private void swap(int a, int b) {
          int temp = h[a];
          h[a] = h[b];
          h[b] = temp;
      }
  
  /** Returns the size of heap. */    
      public int size() {
          return n;
      }
  
  }
  </code></pre>
  
  <p>How can i design a method to remove any element from this <code>MinHeap</code>?</p>