Top view of bst

i want to know that we take input without prior knowledge of height of tree and how tobuild the tree level order wise , help me from the code please.

Hi Aman,
Level order input of a tree is actually quite similar to BFS traversal of a tree. We use a queue to store the nodes and take the input of their children one by one , left to right , level order wise .

Refer to this code to get the level order input function - https://ide.codingblocks.com/s/94006

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.