Graph Theory37 sections · 1633 units
Open in Course

Section Recap

What we learned

You learned how to solve problems on trees using dynamic programming. Process nodes from leaves to root. Define state (count, max, include/exclude). Combine child values to compute parent values. You solved three problems: counting subordinates (sum aggregation), robbing houses (include/exclude), and maximum path sum (path through vs from node).

Next time you see a tree problem asking for the best value, you know what to do: subtree DP.