Delete Node From BST

My Code is not working .
It is not showing any output plz check the code and make the changes and let me know my mistake.

problem : https://online.codingblocks.com/app/player/39658/content/55448/5293/code-challenge?code=y6428slObFnnjwlKSRcKtqKAbWKG5prg

code : https://ide.codingblocks.com/s/195928

plz reply ASAP

Hello @sengarankit98,

  1. It is specified in the question you have to print the pre order of the tree after deleting all m node.
    You are printing inorder.

  2. Print the output of each of test case on a separate line.
    Solution:
    write cout<<endl; as the last statement inside the while loop.

  3. The following statement is incorrect:
    root->right=deletion(root,replace->data);
    Solution:
    root->right=deletion(root->right,replace->data);
    Reason:
    You have replaced root->data with replace->data.

  4. deletion() function is incomplete.
    All the statements you have written would come under the conditional check:
    if(root->data=d)
    Correct implementation:
    https://ide.codingblocks.com/s/196021

Hope, this would help.
Give a like if you are satisfied.