https://www.cnblogs.com/grandyang/p/9914546.html
类似于二分查找的方法,用迭代的方法去做
注意:无论是进入左子树还是右子树,左右子树都变成了新的数,所以需要重新根据root->left = ....来重新生成
class Solution { public: TreeNode* insertIntoBST(TreeNode* root, int val) { if(root == NULL) return new TreeNode(val); if(root->val < val) root->right = insertIntoBST(root->right,val); if(root->val > val) root->left = insertIntoBST(root->left,val); return root; } };