Delete nodes from BST

why is my answer not passing the test cases
here is my code:https://ide.codingblocks.com/s/327831

Hey @jatinupadhyay786
Replace line 60-76 by
node*temp=root->right;
while(temp->left)
{
temp=temp->left;
}
root->data = temp->data;
root->right = deleteNode(root->right, temp->data); //change

and in main uncomment line 131 i.e cout<<endl;

1 Like

thank u so much brother

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.