Re: Finding the subtree with the largest weight



"Debajit Adhikary" <debajit1@xxxxxxxxx> wrote in message
Lets say I have a weighted tree (with positive, zero and negative
weights for each node).
How could I best find the subtree having the maximum weight?

As the problem is specified, I don't think there is an easy answer except to recursively examine every node, and keep a list of weights. Then take the highest.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


.