← Tree Traversal
Tree Traversal Target: 10s
Recursive node counting teaches divide-and-conquer tree thinking.
def count(node): if not node: return 0 return 1 + count(node.left) + count(node.right)
Type it from memory. Go.