15/38
Part 3 of 7 · Your own stackWatch
Watch · 15 min
The height of a binary tree three ways, the same three this track teaches. LeetCode's maximum depth counts nodes, so it's this lesson's height plus 1. Recursive depth-first search from 1:28, breadth-first search one level at a time from 5:30, and depth-first search with a stack of (node, depth) pairs from 10:43, which is this section's pre-order walk.
Maximum Depth of Binary Tree - 3 Solutions - Leetcode 104 - Python · NeetCode · Jun 2021YouTube