I am facing issues in questions in which Given is a tree with no fixed root, n<=1e5 . I can simply do the question if i traverse the tree for each node as root (n^2) but it gives TLE. I know i have to apply DP and rerooting concept.
Can anyone provide me a blog for this particular topic? Or some handful questions on that to learn with the topic? (my rating:1600)
Any help is appreciated. Thanks