Tree_Vertical_OrderTraversal


what is wrong with this code, as i am not able to debug.

Hello @rajukumarbhui

The input for your tree should be
1 2 3 4 5 6 7 -1 -1 -1 -1 -1 8 -1 9 -1 -1 -1 -1
and NOT
4
1 2 3 4 5 6 7 -1 -1 -1 -1 -1 8 -1 9 -1 -1 -1 -1
because you don’t need to know the number of levels in the tree to input the tree.

Try and run it on 1 2 3 4 5 6 7 -1 -1 -1 -1 -1 8 -1 9 -1 -1 -1 -1

sir it is giving wrong answers but it passes the sample test case. https://ide.codingblocks.com/s/159738

Hello @rajukumarbhui

The test cases would fail. Because the input that your code is given from HackerBlocks is
4
1 2 3 4 5 6 7 -1 -1 -1 -1 -1 8 -1 9 -1 -1 -1 -1
so just input that one single integer at the start of your code
The modified code