Answering for every root
A quantity is computed for the tree rooted at node 1. Now it is wanted for every node as the root.
Why is re-running the traversal from each node unsatisfying?
A quantity is computed for the tree rooted at node 1. Now it is wanted for every node as the root.
Why is re-running the traversal from each node unsatisfying?