Question:
You are given a rooted binary tree (each node has at most two children). For a simple path p between two nodes in the tree, let mp be the node on the path that is highest (closest to the root). Define the weight of a path w(p) = Σ_u∈p d(u, mp), where d denotes the distance (number of edges on the path between two nodes). That is, every node on the path is weighted by the distance to the highest node on the path.
The question asks an algorithm that finds the maximum weight among all simple paths in the tree. I'm not sure if I interpreted correctly, but can I just find the longest path from mp to the farthest node? I haven't figure out which algorithm is appropriate for this question, but I think recursive is one way to do it. Again, I don't understand the question very well, it would be better if someone could "translate" it for me and guide me to the solution.