Convert BST to Greater Tree
给一个bst, 把其中的node的值变为比他大的同根node的值. 直接遍历求和就好.
class Solution {
private int s = 0;
public TreeNode convertBST(TreeNode root) {
if(root == null)
return null;
convertBST(root.right);
s += root.val;
root.val = s;
convertBST(root.left);
return root;
}
}