max path size for an unordered binary tree
Date: 08/28/05
(Algorithms) Keywords: no keywords
Greetings,
I have been puzzling over the question of how to find the max path size of a unordered binary tree. For eg: If a node in the BT stores integers as data, then the particular root to leaf path that has the highest sum of integers is the max path - and the sum is the max path size.
I can easily find the max depth, but max depth != max sum always.
Other than walking all possible paths and *manually* storing the sum per path for later comparison, can I use recursion to do all the storing and retreiving for me ?
Source: http://community.livejournal.com/algorithms/64727.html