Given a forest, handle: - link u v: Add edge (forest property maintained) - cut u v: Remove edge - add u v x: Add x to all nodes on path u to v - query u v: Sum of values on path u to v This extends connectivity with path aggregates. Link-Cut trees handle this naturally with lazy propagation for updates and subtree sums for queries.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/data-structures/link-cut-trees/problem-dynamic-path-queries
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████████████████████████████████████████████████████████████████████████████████████