This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingEvery parent must be at most its children, in the tree shape or in the array that stores it.
What this asks
Check whether a heap tree or array satisfies the parent-beats-children rule.
One pass: every cell must be at most both of its children, at 2i+1 and 2i+2 in array form.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing