You are viewing a single comment's thread. Return to all comments →
Hint:
1. Consider traveling to visit all the nodes and leaves in a tree(with a weight in each path), beginning at the root, and then circle back to the root also finally, what you would find? no matter which path you choose, no matter which node you pick as the root, the distance would be 2 * sum of all the path weight. 2. What if only travel some particular nodes, which means these nodes have letters? 3. if not necessary circle back to the same node, which path would be the shortest path? 4. How to find a the maximum distance in a tree? 5. Sum all the path in the tree that connecting all the k letter cities 6. The result would be 2 * sum of all the effective path - maximum distance of two cities within all the k letter cities
Seems like cookies are disabled on this browser, please enable them to open this website
Jeanie's Route
You are viewing a single comment's thread. Return to all comments →
Hint: