Tree Bottom View

could you please explain what exatly is to be done in this question,how is the output justified for this inout?

@Vibhuti0206 Please refer this Bottom view of binary tree one test case fail I have explained a case here.

still couldnot understand,which nde is to be included in bottom’s up approach?

@Vibhuti0206 You need to include all the nodes and form the tree as you always do. But while traversing(level order traversal), maintain a hashmap( with horizontal distance as the key and the value of the node a the value). The last value of each key would form the bottom view.
Relate with this case:

got the logic,how do we maintain hashmap?

use unordered_map of STL… It is taught how to use it in the hashing section of your course

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.