669. 修剪二叉搜索树
class Solution {
public TreeNode trimBST(TreeNode root, int L, int R) {
if(root ==null) return root;
//开始修剪了
if (root.val>R) return trimBST(root.left,L,R);//裁剪左边。。
if (root.val<L) return trimBST(root.right,L,R);//裁剪右边。。
root.left= trimBST(root.left , L ,R ) ;
root.right= trimBST(root.right,L,R);
return root;
}
}