Dynamic DP (DDP) handles dynamic tree updates (such as node weight changes) while answering global queries (e.g. maximum independent set) in $O(log^2 N)$ time per modification. By decomposing trees into heavy chains and expressing transitions as tropical $(max, +)$ matrix multiplications, segment trees maintain chain products efficiently.
Dynamic Dynamic Programming (DDP): Heavy-Light Decomposition & Matrix Segment Trees on Trees
Ready to Master LeetCode Hard Patterns?
Get instant lifetime access to all 45 video lectures, interactive source code templates, and interview prep guides.