How i will find number of values as input? without using string

How i will find number of values as input?? without using string … It is given in question that for n there will be 2^n - 1 input but there is more than that in input??

@codingblockscpp you have to take level order input in this question
Level order input is taken and tree is build by using the queue, in which firstly u will take a queue of nodes, and then it will have a data which will represent a root node, and then u will accept the left and right child of root node, -1 value means that the node does not have any child.

U can refer to this code for your help :smiley:


dont forget to mark the doubt resolved and hit like if cleared :smiley:

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.