Untitled
unknown
plain_text
2 years ago
318 B
8
Indexable
TreeNode<int>* insertionInBST(TreeNode<int>* root, int val)
{
if(root==NULL){
TreeNode<int>* tmp=new TreeNode<int>(val);
return tmp;
}
if(val<root->val) root->left=insertionInBST(root->left,val);
if(val>root->val) root->right=insertionInBST(root->right,val);
return root;
}Editor is loading...