In input format for this question , will be there -1 for every NULL node in the tree.
for example can this be an input 2 -1 3 -1 -1 -1 -1
Tree Bottom view question
Yes… -1 means a NULL node
here my code , https://ide.codingblocks.com/s/298215 . Can you please tell me why this is not working.
Consider the case:
20 8 22 5 3 4 25 -1 -1 10 14 -1 -1 -1 -1 -1 -1 -1 -1
Expected Output:
5 10 4 14 25
Your Output:
5 10 4 22 25
Refer this for the correct approach Bottom view of binary tree one test case fail