Minimum Subtree
Given a binary tree, find the subtree with minimum sum. Return the root of the subtree.
Example
Given a binary tree:
return the node1
.
Note
子树和问题,维护一个最小的全局变量
Code
Last updated
Given a binary tree, find the subtree with minimum sum. Return the root of the subtree.
Given a binary tree:
return the node1
.
子树和问题,维护一个最小的全局变量
Last updated