in the code we wrote max(left.height …) but height is not a member function of node class? shouldn’t we have written something like max(height(left),height(right)…)?
p is a object of Pair class
and Pair class has 2 data members height and diameter
so you can use left.height
in this question the data member of the pair class int height is the function height which we defined earlier or a new variable like int diamater?
it’s just a variable of type int
Yes , like int diameter