Groups
Category
Level
DP on trees is a technique that computes answers for each node by combining results from its children using a post-order DFS.
Tree diameter is the longest simple path in a tree and can be found with two BFS/DFS runs.