I dont get the output of this question ,

may please explain this using a tree diag. how the buttom is considred by question. beacuse i think answer is either 4,5,6,3 0r 4,2,5,6,3

HI @Adi_choudhary,
Here is the view of tree in other view
2 => 1 <= 3
4 => 2 <= 5
-1 => 4 <= -1
END => -1 <= END
END => -1 <= END
-1 => 5 <= -1
END => -1 <= END
END => -1 <= END
6 => 3 <= -1
-1 => 6 <= -1
END => -1 <= END
END => -1 <= END
END => -1 <= END
How actually your doubt is correct both 5 and 6 are overlapping so in such overlap cases we take the one which comes later while traversal … So in our case 5 will come before 6 while traversal so we take 6 in bottom view.

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.