Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,
1
/ \
2 3
Return 6.
本文介绍了一种算法,用于在给定的二叉树中找到具有最大路径和的路径。路径可以从树的任意节点开始,并结束于任意节点,但不能重复访问节点。
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,
1
/ \
2 3
Return 6.
221

被折叠的 条评论
为什么被折叠?