# The optimal way to find leaves in a weighted full binary tree

Let T be a full binary weighted tree. For a node v in T, the cost of going right is a i.e w(v, v.right) = a while w(v, v.left) = b

How do I find optimal paths to all leaves from the root. I don't think classical graph traversals are helpful in this context as I don't need to visit all nodes.

• I'm not sure what you mean. In a tree, there's only one way to get from $A$ to $B$ so all routes that visit all leaves have the same cost. – David Richerby Apr 30 '18 at 10:12