Only the last element of the array is being deleted from the tree

unable to open the code, can you please share it in some different platform like gfg.

thanks

the only problem in your code is: condition when you delete from root->left in BST.

the condition should be if(data < root->data){ //delete from left tree}
you wrote the condition in reverse. and you forgot to return root in case of 2 children

updated code:https://ide.codingblocks.com/s/212324
please rate and resolve if satisfied.
thanks

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.