Core Patterns
Trees: DFS & BFS
Think recursively: each call answers a question about one subtree. Master DFS (pre/in/post-order), BFS level by level, and the BST property.
0 of 3 lessons complete, 0 of 8 problems solved
Coursework
39 min
Up next
Trees & recursive DFS
Read tree notation, build trees, and solve problems by asking what each call returns.
13 min
Passing state & BFS level by level
Send information down with parameters, bring answers up with returns, and walk a tree row by row.
14 min
BSTs, iterative DFS & recursion depth
Use the BST ordering to skip half the tree, and traverse with your own stack when recursion gets deep.
12 min
Practice ladder
Start with the first problem, then work toward the harder variations. Run examples before submitting against all tests.
Next unit: Heaps & Top-K