Challenges-Trees : Structurally Identical

In this problem I know how to work out the problem in a recursive manner and also by some string manipulations.
I want to seek help for this question so as to solve using recursion , in the first place I need to build a tree with the given input integer and boolean values. Can you just help me to write a buildTree( ) function so as to create the tree using this input. I am stuck. Kindly help.
Just help me with creating the tree with this type of input. I dont need help with the algorithm part.
Thank You!

hello @rkganeshan2010

image

first read root node.
then check whether left subtree exist or not by reading a string .
if it is true that means left subtree exist ,so build left tree recursively
otherwise assign NULL to left of current node.

again read one more string to check whether right subtree exist or not.
if it exist(string is true) then build it recursively
otherwise
assign NULL to right of current node

and at the end return current node

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.