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 pricingCount the nodes of a complete tree faster than visiting them all.
What this asks
Count the nodes of a complete tree faster than visiting them all.
Compare the two extreme left paths: when their depths match, the left subtree is perfect and its count is 2^depth - 1, so only the right side needs recursion, and the other way round.
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