Wrong answer in BST operations

I’m getting wrong answer in BST operations question. I checked my code but couldn’t find error in my code. Could anyone please tell me what’s wrong in this code?

problem link : https://www.codechef.com/problems/BSTOPS

My solution : https://www.codechef.com/viewsolution/34945379

Thanks in advance.