Help with error

sol: https://ide.codingblocks.com/s/413565

prob: https://hack.codingblocks.com/app/contests/2022/79/problem

hello @raghav007
check now->

correct ur output format.
it should be in this format->
image

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

image

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->
image

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.