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 pricingFind the height of a binary tree: the longest drop from the root to a leaf.
What this asks
Find the height of a binary tree: the longest drop from the root to a leaf.
A leaf has height 0, and any other node is 1 plus the taller of its two children; one recursive walk answers it.
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