BST Deletion cases

sir in the deletion operation of BST
why do we return return the root in the cases of:

  1. the key>root->data
    2)keydata

because it is just a searching operation?!!
not a deleting so that we need to return anew node.

Hello @mzk1994 this is because when you are either finding in the left subtree or in the right subtree so when we wil go in them at any point we will find the data through that calls only.
so from where we have entered we have return from there onyl and we have to get the answer returned.
this is the case:
if you still have any doubt you can ask here;
Happy Learning!!

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.