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 pricingDecide whether every internal node has two children and every leaf sits at the same depth.
What this asks
Decide whether every internal node has two children and every leaf sits at the same depth.
Compute the height once, then walk: a node whose depth equals the height must be a leaf, and every shallower node must have both children.
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