Structurally identical binary tree

Can you please explain me what’s the question here.

I know we have to prove if they are identical but I don’t understand how tree is formed here with all the true and false.

Hello @div_yanshu07 you can form the tree i.e if there is true value then you will attach the data value to the corresponding side otherwise if it is fase then you will attach null value.
try to go in this way:
in this you can make the build function in which you will give two conditions one for when the string is true and the other for false when the it has no child.
when it has no child you will simple attach null to it but when it has child then you will form the node for the data value and then you will check for the child strings of and then pass them to attach at the left and right following the same criteria mentioned above.
Here for your reference i am attaching the code:


if you have any doubt you can ask here;
Happy Learning!!

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.