Maximum Depth of Binary Tree
Find the maximum depth of a binary tree using divide-and-conquer recursion.
01The problem
Given the root of a binary tree, return its maximum depth: the number of nodes along the longest path from the root node down to the farthest leaf node.
text
3
/ 9 20
/ 15 7
Maximum Depth: 3Constraints
- The number of nodes in the tree is in the range
[0, 10^4]. -100 <= Node.val <= 100
Loading the rest of the lesson…