Please explain how to construct tree from these format of input

Please explain how to construct tree from these format of input

@sahazeer123 hey you are given preorder traversal and true indicates when that child is present or fall represent for NULL.Use recursion to build tree,here is psuedo code:
node *build(string s){
if(s==“true”){
int d;
cin>>d;
node *root = new node(d);
string l;
cin>>l;
if(l==“true”){
root->left=build(l);
}
string r;
cin>>r;
if(r==“true”){
root->right=build®;
}
return root;
}
return NULL;
}

Explanation is not clear. Is input given to us in string format?

@sahazeer123 hey it is given like root left right format ,means first input is integer than second input is string for left,third is also string for right child ,hope you get it.

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.