eapify takes an arbitrary vector or array and converts it into a representation of a valid minheap by calling <span class="code-chonk">precolateDown()</span> on all the nodes from the bottom-rightmost non-leaf node back through the root node (index 0), like so:</p>
<pre style="margin-left: 30px; font-family: monospace; font-size: 11px; width: 600px; background-color: #fff9e7;"><strong>int</strong> getParent(<strong>int</strong> child)<br />{<br />   <strong>return</strong> (child - 1) / 2;<br />}<br /><stro