LeetCode
104. Maximum Depth of Binary Tree
Depth is defined through the subtrees: a tree's max depth is 1 (for the root) plus the larger of its two subtrees' depths, with the empty tree bottoming out at 0. One DFS that recurses down to the…
Loading…