Tree Building input format

I am not able to make the function to take input in this way, though I have made the function to answer the question. Could you help me with the tree building code?

can you please elaborate more on what issue you are facing…in this ques you have to take input in pre order format…pre order format means
NODE ,LEFT CHILD, RIGHT CHILD

The values of all the nodes in the binary tree in pre-order format where true suggest the node exists and false suggests it is NULL

I understood the question, but not able to understand how to write code, because we don’t know whether we will get the string NULL or an integer.

see the user will enter the input one by one if it will be true then that node will have a particular child(subtree) if the user enters false then that node will have no child and this its corresponding child pointer will have value null

also as it is a function problem the code for take input is already written so you can refer to that code for better understanding…the process of taking input is in pre order format and we have used recursion as a tool to take input