Delete Nodes From BST

I tried solving this question,however only 1 test case passes.
Help me find t he issue with my code

LINK : https://ide.codingblocks.com/s/324352

at line no 65 you called for right part but you have to call for right half
root->right = deleteNode(root->right, replace->data);

also after preorder traversal you have to print newline using cout<<endl;

after that it pass all testcase

Modified Code