sol: https://ide.codingblocks.com/s/413565
prob: https://hack.codingblocks.com/app/contests/2022/79/problem
sol: https://ide.codingblocks.com/s/413565
prob: https://hack.codingblocks.com/app/contests/2022/79/problem
it is showing seg fault
the input that u have given is invalid.
size of both the array should be same
I’m not able to figure out how to print it in that manner

do preorder traveral , and print the mentioned details
void print(node* root){
if(root == NULL){
return;
}
cout<<root->data;
print(root->left);
print(root->right);
}
can you give some hints
refer this->

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.