//如果比当前节点大,插在右子树,反之则插在左子树
var insertIntoBST = function(root, val) {
if(root==null){
let node=new TreeNode(val)
return node
}
if(val>root.val){
//插入新节点,则子树需更新
root.right=insertIntoBST(root.right,val)
}else{
root.left=insertIntoBST(root.left,val)
}
return root
};