insertion node in bst, BST
TreeNode* insert(TreeNode *root, TreeNode *node) {
if(!node) return root;
if(!root) return node;
if(root->val == node->val) return root; // already in tree, no need to insert
if(node->val < root->val) {
if(root->left == NULL) root->left = node; // gist, insert into a vacant position here
else root->left = insert(root->left, node);
}
else {
if(root->right == NULL) root->right = node; // gist, insert into a vacant position here
else root->right = insert(root->right, node);
}
return root;
}