Delete node from bst


why code is giving segmetatio fautlt


I have made few changes in the code and the reason in the comment.

@dakshi
hello dakshi,
image
in this line replace root->left with root->rigth.
because we are replacing replacing root->data with inorder succesor. which is in right subtree.
so after replacing to delete inorder successor we need to call same function on right subtree.