PROBLEMS/TREES
Trees LeetCode Problems
253 hand-tagged Trees problems across 5 interview patterns (DFS Traversal (Inorder, Preorder, Postorder), BFS / Level-Order Traversal, BST Operations (Insert, Delete, Validate), Lowest Common Ancestor, Path Sum Problems), ranked by importance (how often each pattern shows up in real coding interviews). Work top-down within each pattern.
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Serialize and Deserialize Binary Tree | Medium | 1672 | 89 | BFS / Level-Order Traversal · Frequency Counting / Hash Map Lookup |
| 2 | Maximum Depth of Binary Tree | Easy | 1028 | 88 | BFS / Level-Order Traversal |
| 3 | Binary Tree Inorder Traversal | Easy | 1048 | 88 | |
| 4 | Invert Binary Tree | Easy | 1112 | 88 | BFS / Level-Order Traversal |
| 5 | Diameter of Binary Tree | Easy | 1267 | 88 |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Binary Tree Level Order Traversal | Easy | 1195 | 92 | |
| 2 | Binary Tree Right Side View | Easy | 1337 | 85 | DFS Traversal (Inorder, Preorder, Postorder) |
| 3 | Amount of Time for Binary Tree to Be Infected | Medium | 1711 | 74 | BFS Shortest Path (Unweighted) · DFS Traversal (Inorder, Preorder, Postorder) |
| 4 | N-ary Tree Level Order Traversal | Easy | 1198 | 73 | |
| 5 | All Nodes Distance K in Binary Tree | Medium | 1663 | 72 | DFS Traversal (Inorder, Preorder, Postorder) · Frequency Counting / Hash Map Lookup |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Validate Binary Search Tree | Easy | 1342 | 90 | DFS Traversal (Inorder, Preorder, Postorder) |
| 2 | Delete Node in a BST | Medium | 1476 | 82 | DFS Traversal (Inorder, Preorder, Postorder) |
| 3 | Insert into a Binary Search Tree | Easy | 1152 | 78 | |
| 4 | Construct Binary Search Tree from Preorder Traversal | Medium | 1563 | 72 | DFS Traversal (Inorder, Preorder, Postorder) · Monotonic Stack |
| 5 | Inorder Successor in BSTPREMIUM | Easy | 1378 | 71 | DFS Traversal (Inorder, Preorder, Postorder) |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Lowest Common Ancestor of a Binary Tree | Easy | 1387 | 87 | DFS Traversal (Inorder, Preorder, Postorder) |
| 2 | Lowest Common Ancestor of a Binary Search Tree | Easy | 1222 | 85 | BST Operations (Insert, Delete, Validate) |
| 3 | Lowest Common Ancestor of a Binary Tree IVPREMIUM | Medium | 1427 | 72 | DFS Traversal (Inorder, Preorder, Postorder) · Frequency Counting / Hash Map Lookup |
| 4 | Find Distance in a Binary TreePREMIUM | Medium | 1487 | 72 | DFS Traversal (Inorder, Preorder, Postorder) |
| 5 | Lowest Common Ancestor of a Binary Tree IIPREMIUM | Medium | 1580 | 72 | DFS Traversal (Inorder, Preorder, Postorder) |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Path Sum III | Medium | 1530 | 82 | Prefix Sums · DFS Traversal (Inorder, Preorder, Postorder) |
| 2 | Path Sum | Easy | 1107 | 78 | DFS Traversal (Inorder, Preorder, Postorder) |
| 3 | Path Sum II | Easy | 1339 | 72 | Path Finding with Backtracking · DFS Traversal (Inorder, Preorder, Postorder) |
EVERY PATTERN
// your mastery





What's your Trees tier?
leaps.gg syncs your LeetCode history and scores your mastery of every pattern, then recommends the exact problems to do next with spaced repetition. Free to start.
GET MY MASTERY MAP →