Trees & BST
Recursion's home turf: traverse, rebuild, and validate hierarchical data.
The idea
The full written guide for Trees & BSTis on its way. The practice progression below is live โ it's the same curated, ordered list our users work through inside the app.
Practice progression
In this order, on LeetCode. Each one adds a wrinkle the previous one didn't have.
- 1#226 Invert Binary TreeEasy
- 2#104 Maximum Depth of Binary TreeEasy
- 3#543 Diameter of Binary TreeEasy
- 4#110 Balanced Binary TreeEasy
- 5#235 Lowest Common Ancestor of a BSTMedium
- 6#102 Binary Tree Level Order TraversalMedium
- 7#98 Validate Binary Search TreeMedium
- 8#230 Kth Smallest Element in a BSTMedium
- 9#105 Construct Binary Tree from Preorder and Inorder TraversalMedium
- 10#124 Binary Tree Maximum Path SumHard
Knowing the pattern is half the job. Showing up daily is the other half.
DSAMotivator tracks this exact progression โ with streaks, XP, and a map that fills in as you go.
Start free โ 7 days