PhantomCodeAI
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
PhantomCodeAI
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
Home
LeetCode Problems
Tree
Tree
Problems
191 Tree LeetCode problems · Solve with AI-powered hints & step-by-step explanations.
94
Binary Tree Inorder Traversal
Easy
95
Unique Binary Search Trees II
Medium
96
Unique Binary Search Trees
Medium
98
Validate Binary Search Tree
Medium
99
Recover Binary Search Tree
Medium
100
Same Tree
Easy
101
Symmetric Tree
Easy
102
Binary Tree Level Order Traversal
Medium
103
Binary Tree Zigzag Level Order Traversal
Medium
104
Maximum Depth of Binary Tree
Easy
105
Construct Binary Tree from Preorder and Inorder Traversal
Medium
106
Construct Binary Tree from Inorder and Postorder Traversal
Medium
107
Binary Tree Level Order Traversal II
Medium
108
Convert Sorted Array to Binary Search Tree
Easy
109
Convert Sorted List to Binary Search Tree
Medium
110
Balanced Binary Tree
Easy
111
Minimum Depth of Binary Tree
Easy
112
Path Sum
Easy
113
Path Sum II
Medium
114
Flatten Binary Tree to Linked List
Medium
116
Populating Next Right Pointers in Each Node
Medium
117
Populating Next Right Pointers in Each Node II
Medium
124
Binary Tree Maximum Path Sum
Hard
129
Sum Root to Leaf Numbers
Medium
144
Binary Tree Preorder Traversal
Easy
145
Binary Tree Postorder Traversal
Easy
173
Binary Search Tree Iterator
Medium
199
Binary Tree Right Side View
Medium
222
Count Complete Tree Nodes
Easy
226
Invert Binary Tree
Easy
230
Kth Smallest Element in a BST
Medium
235
Lowest Common Ancestor of a Binary Search Tree
Medium
236
Lowest Common Ancestor of a Binary Tree
Medium
257
Binary Tree Paths
Easy
297
Serialize and Deserialize Binary Tree
Hard
331
Verify Preorder Serialization of a Binary Tree
Medium
337
House Robber III
Medium
341
Flatten Nested List Iterator
Medium
404
Sum of Left Leaves
Easy
427
Construct Quad Tree
Medium
429
N-ary Tree Level Order Traversal
Medium
437
Path Sum III
Medium
449
Serialize and Deserialize BST
Medium
450
Delete Node in a BST
Medium
501
Find Mode in Binary Search Tree
Easy
508
Most Frequent Subtree Sum
Medium
513
Find Bottom Left Tree Value
Medium
515
Find Largest Value in Each Tree Row
Medium
530
Minimum Absolute Difference in BST
Easy
538
Convert BST to Greater Tree
Medium
543
Diameter of Binary Tree
Easy
558
Logical OR of Two Binary Grids Represented as Quad-Trees
Medium
559
Maximum Depth of N-ary Tree
Easy
563
Binary Tree Tilt
Easy
572
Subtree of Another Tree
Easy
589
N-ary Tree Preorder Traversal
Easy
590
N-ary Tree Postorder Traversal
Easy
606
Construct String from Binary Tree
Medium
617
Merge Two Binary Trees
Easy
623
Add One Row to Tree
Medium
637
Average of Levels in Binary Tree
Easy
652
Find Duplicate Subtrees
Medium
653
Two Sum IV - Input is a BST
Easy
654
Maximum Binary Tree
Medium
655
Print Binary Tree
Medium
662
Maximum Width of Binary Tree
Medium
669
Trim a Binary Search Tree
Medium
671
Second Minimum Node In a Binary Tree
Easy
687
Longest Univalue Path
Medium
690
Employee Importance
Medium
700
Search in a Binary Search Tree
Easy
701
Insert into a Binary Search Tree
Medium
703
Kth Largest Element in a Stream
Easy
783
Minimum Distance Between BST Nodes
Easy
814
Binary Tree Pruning
Medium
834
Sum of Distances in Tree
Hard
863
All Nodes Distance K in Binary Tree
Medium
865
Smallest Subtree with all the Deepest Nodes
Medium
872
Leaf-Similar Trees
Easy
889
Construct Binary Tree from Preorder and Postorder Traversal
Medium
894
All Possible Full Binary Trees
Medium
897
Increasing Order Search Tree
Easy
919
Complete Binary Tree Inserter
Medium
938
Range Sum of BST
Easy
951
Flip Equivalent Binary Trees
Medium
958
Check Completeness of a Binary Tree
Medium
965
Univalued Binary Tree
Easy
968
Binary Tree Cameras
Hard
971
Flip Binary Tree To Match Preorder Traversal
Medium
979
Distribute Coins in Binary Tree
Medium
987
Vertical Order Traversal of a Binary Tree
Hard
988
Smallest String Starting From Leaf
Medium
993
Cousins in Binary Tree
Easy
998
Maximum Binary Tree II
Medium
1008
Construct Binary Search Tree from Preorder Traversal
Medium
1022
Sum of Root To Leaf Binary Numbers
Easy
1026
Maximum Difference Between Node and Ancestor
Medium
1028
Recover a Tree From Preorder Traversal
Hard
1038
Binary Search Tree to Greater Sum Tree
Medium
1080
Insufficient Nodes in Root to Leaf Paths
Medium
1104
Path In Zigzag Labelled Binary Tree
Medium
1110
Delete Nodes And Return Forest
Medium
1123
Lowest Common Ancestor of Deepest Leaves
Medium
1145
Binary Tree Coloring Game
Medium
1161
Maximum Level Sum of a Binary Tree
Medium
1261
Find Elements in a Contaminated Binary Tree
Medium
1302
Deepest Leaves Sum
Medium
1305
All Elements in Two Binary Search Trees
Medium
1315
Sum of Nodes with Even-Valued Grandparent
Medium
1325
Delete Leaves With a Given Value
Medium
1339
Maximum Product of Splitted Binary Tree
Medium
1361
Validate Binary Tree Nodes
Medium
1367
Linked List in Binary Tree
Medium
1372
Longest ZigZag Path in a Binary Tree
Medium
1373
Maximum Sum BST in Binary Tree
Hard
1376
Time Needed to Inform All Employees
Medium
1377
Frog Position After T Seconds
Hard
1379
Find a Corresponding Node of a Binary Tree in a Clone of That Tree
Easy
1382
Balance a Binary Search Tree
Medium
1443
Minimum Time to Collect All Apples in a Tree
Medium
1448
Count Good Nodes in Binary Tree
Medium
1457
Pseudo-Palindromic Paths in a Binary Tree
Medium
1483
Kth Ancestor of a Tree Node
Hard
1519
Number of Nodes in the Sub-Tree With the Same Label
Medium
1530
Number of Good Leaf Nodes Pairs
Medium
1569
Number of Ways to Reorder Array to Get Same BST
Hard
1600
Throne Inheritance
Medium
1609
Even Odd Tree
Medium
1617
Count Subtrees With Max Distance Between Cities
Hard
1719
Number Of Ways To Reconstruct A Tree
Hard
1766
Tree of Coprimes
Hard
1916
Count Ways to Build Rooms in an Ant Colony
Hard
1932
Merge BSTs to Create Single BST
Hard
1993
Operations on Tree
Medium
2003
Smallest Missing Genetic Value in Each Subtree
Hard
2049
Count Nodes With the Highest Score
Medium
2096
Step-By-Step Directions From a Binary Tree Node to Another
Medium
2196
Create Binary Tree From Descriptions
Medium
2236
Root Equals Sum of Children
Easy
2246
Longest Path With Different Adjacent Characters
Hard
2265
Count Nodes Equal to Average of Subtree
Medium
2322
Minimum Score After Removals on a Tree
Hard
2331
Evaluate Boolean Binary Tree
Easy
2368
Reachable Nodes With Restrictions
Medium
2385
Amount of Time for Binary Tree to Be Infected
Medium
2415
Reverse Odd Levels of Binary Tree
Medium
2421
Number of Good Paths
Hard
2440
Create Components With Same Value
Hard
2458
Height of Binary Tree After Subtree Removal Queries
Hard
2467
Most Profitable Path in a Tree
Medium
2471
Minimum Number of Operations to Sort a Binary Tree by Level
Medium
2476
Closest Nodes Queries in a Binary Search Tree
Medium
2477
Minimum Fuel Cost to Report to the Capital
Medium
2509
Cycle Length Queries in a Tree
Hard
2538
Difference Between Maximum and Minimum Price Sum
Hard
2581
Count Number of Possible Root Nodes
Hard
2583
Kth Largest Sum in a Binary Tree
Medium
2603
Collect Coins in a Tree
Hard
2641
Cousins in Binary Tree II
Medium
2646
Minimize the Total Price of the Trips
Hard
2673
Make Costs of Paths Equal in a Binary Tree
Medium
2791
Count Paths That Can Form a Palindrome in a Tree
Hard
2846
Minimum Edge Weight Equilibrium Queries in a Tree
Hard
2867
Count Valid Paths in a Tree
Hard
2872
Maximum Number of K-Divisible Components
Hard
2920
Maximum Points After Collecting Coins From All Nodes
Hard
2925
Maximum Score After Applying Operations on a Tree
Medium
2973
Find Number of Coins to Place in Tree Nodes
Hard
3067
Count Pairs of Connectable Servers in a Weighted Tree Network
Medium
3068
Find the Maximum Sum of Node Values
Hard
3203
Find Minimum Diameter After Merging Two Trees
Hard
3241
Time Taken to Mark All Nodes
Hard
3249
Count the Number of Good Nodes
Medium
3319
K-th Largest Perfect Subtree Size in Binary Tree
Medium
3327
Check if DFS Strings Are Palindromes
Hard
3331
Find Subtree Sizes After Changes
Medium
3367
Maximize Sum of Weights after Edge Removals
Hard
3372
Maximize the Number of Target Nodes After Connecting Trees I
Medium
3373
Maximize the Number of Target Nodes After Connecting Trees II
Hard
3425
Longest Special Path
Hard
3486
Longest Special Path II
Hard
3515
Shortest Path in a Weighted Tree
Hard
3544
Subtree Inversion Sum
Hard
3553
Minimum Weighted Subgraph With the Required Paths II
Hard
3558
Number of Ways to Assign Edge Weights I
Medium
3559
Number of Ways to Assign Edge Weights II
Hard
3562
Maximum Profit from Trading Stocks with Discounts
Hard
3575
Maximum Good Subtree Score
Hard
3585
Find Weighted Median Node in Tree
Hard
3590
Kth Smallest Path XOR Sum
Hard
3593
Minimum Increments to Equalize Leaf Paths
Medium
← Browse all LeetCode problems