Tree DP Problems

Fixed Root Tree DP Problems

Problem IDTitleSolutionTagsDifficulty
0543Diameter of Binary Tree LeetCode XXXX Tree, Depth-First Search, Binary TreeEasy
0124Binary Tree Maximum Path Sum LeetCode XXXX Tree, Depth-First Search, Dynamic Programming, Binary TreeHard
1245Tree Diameter LeetCode XXXX Tree, Depth-First Search, Breadth-First Search, Graph, Topological SortMedium
2246Longest Path with Different Adjacent Characters LeetCode XXXX Tree, Depth-First Search, Graph, Topological Sort, Array, StringHard
0687Longest Univalue Path LeetCode XXXX Tree, Depth-First Search, Binary TreeMedium
0337House Robber III LeetCode XXXX Tree, Depth-First Search, Dynamic Programming, Binary TreeMedium
0333Largest BST SubtreeTree, Depth-First Search, Binary Search Tree, Dynamic Programming, Binary TreeMedium
1617Count Subtrees with Max Distance Between Cities LeetCode XXXX Bit Manipulation, Tree, Dynamic Programming, State Compression, EnumerationHard
2538Difference Between Maximum and Minimum Price Sum LeetCode XXXX Tree, Depth-First Search, Array, Dynamic ProgrammingHard
1569Number of Ways to Reorder Array to Get Same BSTTree, Union Find, Binary Search Tree, Memoization, Array, Mathematics, Divide and Conquer, Dynamic Programming, Binary Tree, CombinatoricsHard
1372Longest ZigZag Path in a Binary TreeTree, Depth-First Search, Dynamic Programming, Binary TreeMedium
1373Maximum Sum BST in Binary TreeTree, Depth-First Search, Binary Search Tree, Dynamic Programming, Binary TreeHard
0968Binary Tree Cameras LeetCode XXXX Tree, Depth-First Search, Dynamic Programming, Binary TreeHard
1273Delete Tree NodesTree, Depth-First Search, Breadth-First SearchMedium
1519Number of Nodes in the Sub-Tree With the Same LabelTree, Depth-First Search, Breadth-First Search, Hash Table, CountingMedium

Variable Root Tree DP Problems

Problem IDTitleSolutionTagsDifficulty
0310Minimum Height Trees LeetCode XXXX Depth-First Search, Breadth-First Search, Graph, Topological SortMedium
0834Sum of Distances in Tree LeetCode XXXX Tree, Depth-First Search, Graph, Dynamic ProgrammingHard
2581Count Number of Possible Root NodesTree, Depth-First Search, Hash Table, Dynamic ProgrammingHard