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 pricingUse the index arithmetic: children of i live at 2i+1 and 2i+2, the parent at (i-1)/2.
What this asks
Locate a heap node's parent and children from its index.
Index arithmetic: children of i live at 2i+1 and 2i+2, the parent at (i-1)/2.
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