🚀 Phases 1–5 are live — Days 1–17 cover the foundations and the algorithmic patterns. See the roadmap →
Day 6 - Binary Trees and BSTPractice QuestionsOverview

Tree Practice Questions

Ten classic tree problems. Each one is a small variation on the three-question recipe from Day 5 — Thinking Recursively: base case for null, recursive call on each child, combine.

Notice how short the solutions are — most are 3–8 lines. That’s the magic of recursion on trees: you describe one level, and the call stack handles the entire structure.

Easy

ProblemPatternStatus
Same TreePair-wise recursionAvailable
Symmetric TreeMirror recursionAvailable
Maximum Depth of Binary TreePostorderAvailable
Invert Binary TreeRecursion + swapAvailable
Path SumTop-down recursionAvailable
Balanced Binary TreePostorder + height (fused traversal)Available
Diameter of Binary TreePostorder + accumulatorAvailable

Medium

ProblemPatternStatus
Binary Tree Level Order TraversalBFS with the snapshot trickAvailable
Validate Binary Search TreeInorder / boundsAvailable
Convert Sorted Array to BSTDivide & conquerAvailable

More Practice (Coming Soon)

ProblemPatternStatus
Lowest Common Ancestor of a BSTTree walk with comparisonsComing Soon
Lowest Common Ancestor of Binary TreePostorder + flag bubblingComing Soon
Construct Binary Tree from Preorder + InorderDivide-and-conquer + index mapComing Soon
Binary Tree Right Side ViewBFS, last of each levelComing Soon
Binary Tree Maximum Path SumPostorder + accumulatorComing Soon
Kth Smallest Element in a BSTInorder, stop at KComing Soon
Binary Tree Zigzag Level OrderBFS + alternating reverseComing Soon
Serialize and Deserialize Binary TreePreorder with null markersComing Soon
Recover BST (two swapped nodes)Inorder + tracking violationsComing Soon