ldiameter -- > diameter of left subtree rdiamter -- > diameter of right subtree height of left subtree and right subtree is obtained from lh and rh and returned value of function is stored in ldiameter and rdiameter
ldiameter = diameterOpt ( root . left , lh ) NEW_LINE rdiameter = diameterOpt ( root . right , rh ) NEW_LINE