2 testcases are not getting passed. please tell the mistake.
The link to the code is as follows:-
Bottom view of tree
Your code is not producing correct output for following test case as,
1 2 3 -1 4 -1 5 -1 -1 -1 6 -1 7 -1 8 -1 -1
Expected Output : 2 4 3 5 6 7 8
Your output : 2 4 7 5 8
Either change your buildtree function or change the approach you are using in the bottomView function…
Thanks for the help. All the testcases are now passed