Https://ide.codingblocks.com/s/221893

why its not working and the mean of left.diameter means left ka diameter and similarly for all

There are lot of compilation error in your code. first, there is a extra brace in line no. 38. second, line no. 49 should be p.height=max (left.height,right.height)+1;
Also pair is already a keyword in c++, change name of your class pair to pair1.

i dind not understand the dry run

take any small sample input and execute your code line by line for that testcase, you’ll find error if they exists.

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.