What wrong in this code
@Adityakumar3112
your code won’t work when you will have to delete root node and left or right subtree doesn’t exists. consider this example
1
7
5 3 2 4 7 6 8
7
5 3 2 4 7 6 8
your code will give segmentation fault in that case.
just change line 116 to root=deleteNode(root,d);
All testcases will pass