Problem library

Tree

All problems that are about tree.

122 / 122 problems
Problem Solved
Lowest common ancestor of a binary tree IV
tree
Aug 7, 2023
Univalued binary tree
tree
May 27, 2023
Kth largest sum in a binary tree
heap tree
May 21, 2023
Diameter of N-ary tree
tree
May 17, 2023
Number of good leaf nodes pairs
tree
May 17, 2023
Equal tree partition
tree
May 10, 2023
Increasing order search tree
tree
May 9, 2023
Number of good paths
tree
Jan 15, 2023
Longest path with different adjacent characters
tree
Jan 13, 2023
Number of nodes in the sub tree with the same label
tree
Jan 12, 2023
Minimum time to collect all apples in a tree
tree graph
Jan 11, 2023
Two sum bsts
tree
Jan 1, 2023
Create binary tree from descriptions
tree
Dec 31, 2022
Convert binary search tree to sorted doubly linked list
linked-list tree
Dec 23, 2022
Flatten a multilevel doubly linked list
linked-list tree
Dec 23, 2022
Sum of distances in tree
tree
Dec 22, 2022
Find distance in a binary tree
tree
Dec 21, 2022
Binary tree longest consecutive sequence
tree
Dec 19, 2022
Clone binary tree with random pointer
tree
Dec 19, 2022
Root equals sum of children
tree
Dec 17, 2022
Longest univalue path
tree
Dec 12, 2022
Lowest common ancestor of deepest leaves
tree
Dec 12, 2022
Maximum level sum of a binary tree
tree
Dec 12, 2022
Smallest subtree with all the deepest nodes
tree
Dec 12, 2022
Maximum product of splitted binary tree
tree
Dec 10, 2022
Find root of N-ary tree
tree
Dec 8, 2022
Range sum of bst
tree
Dec 7, 2022
largest-bst-subtree
tree
Dec 6, 2022
Path sum IV
tree
Dec 1, 2022
Count nodes equal to average of subtree
tree
Nov 30, 2022
Find leaves of binary tree
tree
Nov 30, 2022
Maximum average subtree
tree
Nov 30, 2022
Recover a tree from preorder traversal
tree
Nov 30, 2022
Verify preorder sequence in binary search tree
tree
Nov 30, 2022
Count univalue subtrees
tree
Nov 29, 2022
Inorder successor in BST
tree
Nov 29, 2022
Binary tree vertical order traversal
tree
Nov 28, 2022
Count nodes equal to sum of descendants
tree
Nov 28, 2022
Validate binary tree nodes
tree
Nov 28, 2022
Binary tree upside down
tree
Nov 27, 2022
Linked list in binary tree
linked-list tree
Nov 21, 2022
All nodes distance k in binary tree
tree
Nov 20, 2022
Symmetric tree
tree
Nov 17, 2022
Construct binary search tree from preorder traversal
tree
Nov 16, 2022
Delete nodes and return forest
tree
Nov 16, 2022
Insert into a binary search tree
tree
Nov 16, 2022
Path in zigzag labelled binary tree
tree
Nov 16, 2022
Trim a binary search tree
tree
Nov 16, 2022
Binary tree tilt
tree
Nov 15, 2022
Find duplicate subtrees
tree
Nov 15, 2022
Find mode in binary search tree
tree
Nov 15, 2022
Maximum width of binary tree
tree
Nov 15, 2022
Most frequent subtree sum
tree
Nov 15, 2022
Path sum III
dynamic-programming backtracking tree
Nov 15, 2022
Leaf similar trees
tree
Nov 12, 2022
Check completeness of a binary tree
tree
Nov 6, 2022
Minimum absolute difference in bst
tree
Nov 1, 2022
Search in a binary search tree
tree
Oct 29, 2022
All elements in two binary search trees
tree
Oct 28, 2022
Reverse odd levels of binary tree
tree
Oct 25, 2022
Serialize and deserialize bst
tree design
Oct 25, 2022
Delete leaves with a given value
tree
Oct 16, 2022
Convert bst to greater tree
tree
Oct 9, 2022
Find bottom left tree value
tree
Oct 9, 2022
Flip equivalent binary trees
tree
Oct 9, 2022
Two sum IV input is a bst
tree
Oct 9, 2022
Merge two binary trees
tree
Oct 6, 2022
Add one row to tree
tree
Oct 5, 2022
Deepest leaves sum
tree
Sep 17, 2022
Insufficient nodes in root to leaf paths
tree
Sep 14, 2022
Pseudo palindromic paths in a binary tree
backtracking tree
Sep 14, 2022
Maximum difference between node and ancestor
tree
Sep 11, 2022
Maximum binary tree II
tree
Sep 10, 2022
Maximum binary tree
tree
Sep 10, 2022
Construct string from binary tree
tree
Sep 7, 2022
Print binary tree
tree
Sep 7, 2022
Binary tree pruning
tree
Sep 6, 2022
Amount of time for binary tree to be infected
tree
Sep 4, 2022
Binary search tree iterator
tree
Sep 4, 2022
Binary tree level order traversal II
tree
Sep 4, 2022
Binary tree zigzag level order traversal
tree
Sep 4, 2022
Construct binary tree from inorder and postorder traversal
tree
Sep 4, 2022
Convert sorted list to binary search tree
tree
Sep 4, 2022
Count complete tree nodes
tree
Sep 4, 2022
delete-node-in-a-bst
tree
Sep 4, 2022
Populating next right pointers in each node II
tree
Sep 4, 2022
Populating next right pointers in each node
tree
Sep 4, 2022
Recover binary search tree
tree
Sep 4, 2022
Vertical order traversal of a binary tree
tree
Sep 4, 2022
Balance a binary search tree
tree
Sep 3, 2022
Average of levels in binary tree
tree
Sep 2, 2022
Sum root to leaf numbers
tree
Sep 2, 2022
N-ary tree level order traversal
tree
Sep 1, 2022
Construct binary tree from preorder and postorder traversal
tree
Aug 21, 2022
Cousins in binary tree
tree
Aug 21, 2022
Convert sorted array to binary search tree
tree
Aug 10, 2022
Binary tree maximum path sum
tree
Aug 6, 2022
Kth smallest element in a bst
tree
Aug 6, 2022
Serialize and deserialize binary tree
tree design
Aug 6, 2022
Validate binary search tree
tree
Aug 6, 2022
My calendar I
tree
Aug 3, 2022
Flatten binary tree to linked list
tree
Jul 27, 2022
Count good nodes in binary tree
tree
Jul 26, 2022
Lowest common ancestor of a binary tree
tree
Jul 26, 2022
Binary tree inorder traversal
tree
Jul 20, 2022
Binary tree postorder traversal
tree
Jul 20, 2022
Binary tree preorder traversal
tree
Jul 20, 2022
N-ary tree postorder traversal
tree
Jul 20, 2022
N-ary tree preorder traversal
tree
Jul 20, 2022
Path sum
tree
Jul 19, 2022
Find largest value in each tree row
tree
Jul 18, 2022
Lowest common ancestor of a binary search tree
tree
Jul 18, 2022
Balanced binary tree
tree
Jul 14, 2022
Construct binary tree from preorder and inorder traversal
tree
Jul 14, 2022
Diameter of binary tree
tree
Jul 14, 2022
Invert binary tree
tree
Jul 14, 2022
Maximum depth of binary tree
tree
Jul 14, 2022
Maximum depth of n-ary tree
tree
Jul 14, 2022
Same tree
tree
Jul 14, 2022
Subtree of another tree
tree
Jul 14, 2022
Binary tree level order traversal
tree
Jul 13, 2022
Binary tree right side view
tree
Jul 11, 2022