@@ -0,0 +1,771 @@
+/**%0A * Definition for a binary tree node.%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 */%0Aclass Solution %7B%0A    public void flatten(TreeNode root) %7B%0A        if (root == null) %7B%0A            return;%0A        %7D%0A%0A        TreeNode right = root.right;        %0A        flatten(root.left);%0A        root.right = root.left;%0A        root.left = null;%0A%0A%0A        flatten(right);%0A        TreeNode cur = root;%0A        while(cur.right != null) %7B%0A            cur = cur.right;%0A        %7D%0A        cur.right = right;%0A    %7D%0A%7D%0A

Create FlattenBst.java