My Leetcode: Binary Tree Maximum Path Sum (Java) Preorderly traverse the whole tree. For each node calculate...

Please Visit: http://ift.tt/1ajReyV



My Leetcode: Binary Tree Maximum Path Sum (Java)

Preorderly traverse the whole tree. For each node calculate Max(root, root+leftSide, root+rightSide, leftSide+root+rightSide ), update max[0] (which is used to store max value), then return Max (root+leftSide, root+rightSide, root)

http://ift.tt/1uZ7aRF

http://ift.tt/UCfJHi



My Leetcode: Binary Tree Maximum Path Sum (Java)







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/UCfMCZ

via LifeLong Community

No comments:

Post a Comment