Tree Bottom view

What does these -1 's in the input format mean ?
1 2 3 4 5 6 -1 -1 -1 -1 -1 -1 -1

@AbhishekAhlawat1102 Bro that basically means no child or null child, I will recommend you to see Tree top view the example tree for this input is drawn there, and keep in mid that it is level order input.

If your doubt is cleared mark this query resolved and rate full!
Happy Coding!

i understand that the input is given in level order and -1 indicates that node a have no children but see the tree after construction given in explanation the nodes do have children. Anyhow, are these -1 ’ s useless in input ? Can’t is costruct the tree based upon the level order input not making use of -1’s?

@AbhishekAhlawat1102 So when did i said that nodes will not have any children?

Ofcourse its a binary tree and you asked me what does -1 means, so i explained.

Now suppose this is the input 1 2 3 4 5 -1 6
So if you will just take 1 2 3 4 5 6, so how will you know that 6 is left child or right child of 3 , the above input signifies that

root is 1, then 2 3 as lef child and rt child then 4 and 5 as l and r child of 2, then -1 here means left child of 3 is null and 6 is r child of 3.

So without considering the null info, you will not be able to construct a specific tree.