cture.)</p>
<p>At first, it might seem like the big-oh runtime for heapify would be O(n log n). After all, we know the worst-case runtime for <span class="code-chonk">percolateDown()</span> is O(log n), and we're calling it n/2 times (since about half the nodes in a complete binary tree are non-leaves).</p>
<p>The runtime is even better than that, though. We incur the O(n log n) worst-case runtime for <span class="code-chonk">percolateDown()</span> when we call it on the root and that value percolates all t