@@ -0,0 +1,1096 @@
+/**%0A *Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in %5BL, R%5D (R %3E= L). You might need to change the root of the tree, so the result should return the new root of the trimmed binary search tree.%0A *Example 1:%0A *Input: %0A *    1%0A *   / %5C%0A *  0   2%0A *%0A *  L = 1%0A *  R = 2%0A *%0A *Output: %0A *    1%0A *      %5C%0A *       2%0A *Example 2:%0A *Input: %0A *    3%0A *   / %5C%0A *  0   4%0A *   %5C%0A *    2%0A *   /%0A *  1%0A *%0A *  L = 1%0A *  R = 3%0A *%0A *Output: %0A *      3%0A *     / %0A *   2   %0A *  /%0A * 1%0A */%0A/**%0A * Definition for a binary tree node.%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Aclass Solution %7B%0A    public TreeNode trimBST(TreeNode root, int L, int R) %7B%0A        if (root == null) return root;%0A        if (root.val %3E R) return trimBST(root.left, L, R);%0A        if (root.val %3C L) return trimBST(root.right, L, R);%0A        %0A        root.left = trimBST(root.left, L, R);%0A        root.right = trimBST(root.right, L, R);%0A        %0A        return root;%0A    %7D%0A%7D%0A

Create TrimABinarySearchTree.java