BST Operations (BSTOPS) : getting wrong answer

Can anybody help me find the error in my code as I am getting wrong answer for the problem BST Operations having code “BSTOPS” in the beginner section. My solution code is : https://www.codechef.com/viewsolution/24411745
I thought that in case where a node has two children it would be printing twice so I created a method “deleteNode” and copied the functionality of method “delete” without printing the position, still I am getting wrong answer. Solution code for this is https://www.codechef.com/viewsolution/24414804

1 Like