What to do if the input is not in this format?
like what if the input does not contain -1 after every leaf node?
how will the build tree function work in that case?
Build tree function doubt
Hello @kamakshi.behl22,
You may refer to this https://prismoskills.appspot.com/lessons/Binary_Trees/Build_tree_from_preorder.jsp
It explains what you have asked.
Let me know if you face any issue.
Hope, this would help.
Give a like if you are satisfied.
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.