Hot100: Maximum Depth of Binary Tree (DFS / BFS ACERS Guide)

Subtitle / Summary “Maximum depth” is one of the cleanest starting points for tree recursion. Once you truly understand that the answer for the current tree depends on the answers from its left and right subtrees, a whole family of tree DP and DFS problems becomes easier. This guide uses LeetCode 104 to explain recursive DFS, level-order BFS, and the engineering value of the same pattern. Reading time: 9-11 min Tags: Hot100, binary tree, DFS, BFS, recursion SEO keywords: Hot100, Maximum Depth of Binary Tree, DFS, BFS, LeetCode 104 Meta description: Learn the DFS and BFS solutions for LeetCode 104 from the definition of depth, with engineering mappings and runnable multi-language code. Target Readers Learners who are just starting tree problems and want to truly internalize “tree recursion return values” Developers who can write traversals but get confused once the task becomes “compute height”, “compute path”, or “compute an answer” Engineers who need depth analysis on hierarchical data such as menus, org charts, or nested JSON Background / Motivation LeetCode 104 looks like an easy problem, but it is almost the parent problem of tree recursion: ...

March 6, 2026 · 9 min · map[name:Jeanphilo]