title: MIN_HEAPIFY algorithm
body: <p>Is the following MIN_HEAPIFY algorithm correct?</p>
  
  <pre><code>MIN_HEAPIFY(A,i)
  {
  l=LEFT(i);//calculates the left childs location
  r=RIGHT(i);//right childs location
  
  if((l&lt;=A.heap_size)AND(A[l]&lt;A[i]))
     small=l;
  else
     small=i;
  
  if((r&lt;=A.heapsize)&amp;&amp;(A[small]&gt;A[r]))
     small=r;
  
  if(small!=i)
    {
     exchange A[i] with A[small];
     MIN_HEAPIFY(A,i)
    }
  }
  </code></pre>