@@ -0,0 +1,837 @@
+public class _0538ConvertBSTToGreaterTree %7B%0A  public TreeNode convertBST(TreeNode root) %7B%0A    if (root != null) %7B%0A      sum(root, 0);%0A    %7D%0A    return root;%0A  %7D%0A%0A  private int sum(TreeNode node, int parentValue) %7B%0A    int midValue = node.val + parentValue;%0A    if (node.right != null) %7B%0A      int value = sum(node.right, parentValue);%0A      midValue = node.val + value;%0A    %7D%0A    node.val = midValue;%0A    int maxValue = node.val;%0A    if (node.left != null) %7B%0A      maxValue = sum(node.left, node.val);%0A    %7D%0A    return maxValue;%0A  %7D%0A%0A  public class TreeNode %7B%0A      int val;%0A      TreeNode left;%0A      TreeNode right;%0A      TreeNode() %7B%7D%0A      TreeNode(int val) %7B this.val = val; %7D%0A      TreeNode(int val, TreeNode left, TreeNode right) %7B%0A          this.val = val;%0A          this.left = left;%0A          this.right = right;%0A      %7D%0A  %7D%0A%7D%0A

Add _0538ConvertBSTToGreaterTree