https://hack.codingblocks.com/app/contests/2022/430/problem
how do I deal with the true and false input
https://hack.codingblocks.com/app/contests/2022/430/problem
how do I deal with the true and false input
Hey @raghav007
node* buildTree()
{
string d;
cin>>d;
if(d=="false")
{
return NULL;
}
node *root=new node(stoi(d));
root->left=preorder_input(root->left);
root->right=preorder_input(root->right);
return root;
}
Do a dry run I havent checked if its working or not
will it work when d is true because it will convert d to an int. if that’s the case maybe we should write else if(d == true) and then cin>>d once again
did you mean to write build here instead of preorder?
Try replacing ur build function with mine
Maine code bhja h usme sirf build function h
there is something wrong with my print level function my build function is also wroking fine when I replace it with your code
thanks a lot, we have covered heaps till now when do you think the course will finish
It may take a month or two at max
Depending on ur speed