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.
code : https://ide.codingblocks.com/s/195928
plz reply ASAP
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.
code : https://ide.codingblocks.com/s/195928
plz reply ASAP
Hello @sengarankit98,
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.
Print the output of each of test case on a separate line.
Solution:
write cout<<endl; as the last statement inside the while loop.
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.
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.