Question
Description Given a binary tree, find the subtree with minimum sum. Return the root of the subtree.
Notice LintCode will print the subtree which root is your return node. It's guaranteed that there is only one subtree with minimum sum and the given binary tree is not an empty tree.
Example
Given a binary tree:
return the node 1.
Explanation
可以用遍历的方式来递归,也可以用分治法。分治法的话要注意自己构造一个类。