BOttom view problem

i have defined hd variable in class node only,but if i am given a function(node*root) where i can’t define my custom class, then how will i use hd?

Hello @samardeep what is the approach that you are using?

@samardeep your code is passing all the test cases.

Yes,it is passing but i am asking like in leetcode you are given a function like bootom_view(noderoot) where you have to print the bottom view,but they define class of their own which has data member as int data,nodeleft,noderight ,but here in Coding Blocks i defined my own custom class which has int data,int hd,noderight,node*left. so how will i implement hd if i am just given the function to complete?

@samardeep okay your are asking about leetcode then brother you can form your one more class and call another function with the parameters you want to have in your function to solve the question.

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.