sol: https://ide.codingblocks.com/s/417297
prob: https://hack.codingblocks.com/app/contests/2022/1339/problem
please check logic seems right to me
sol: https://ide.codingblocks.com/s/417297
prob: https://hack.codingblocks.com/app/contests/2022/1339/problem
please check logic seems right to me
Modified Code
mistake
if(data == NULL){
return NULL;
}
you can’t compare NULL
Solution to problem is make data as string and compare
data with “NULL”
like this
if(data == “NULL”){
return NULL;
}
node* root = new node(stoi(data));
(string to int)
stoi => is a funtion used to convert string to int
oh I initialized a value of an int variable to NULL and outputted it and the output came to be 0 so I thought this should work.
I did using strings but it is raising some error
I have sent the modified Code
in which i resolve all the errors so that you didn’t need to ask doubt again
plz check that code
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.