when i will take input , i dont know where to end.
so how i will solve that.
Regarding input
hello @gagz23
build ur tree recursively by doing a preorder traversal.
take help from this code for clarity->
but if child !=0,1,2 then how to end this code.
@gagz23
given input will always follow the mentioned constraint (i,e child will always be 0,1,2) no other value will be given
how to take inputs? can you send that code?
pls check above shared code. u dont have to write any separate code for taking code.
above code is taking input and building tree same time.
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.