but what is the meaning of max (0,0) it return 1 and the process repeats and how it works i dont understand still pls explain.
Regarding the tree level order
and what you told why it is returning 1 i dont understand
can u tell mme so i undersytand
why i m not getting answer
Hey @ssmit_joshi , I think you have a doubt in the height of the tree .
See max(0,0) = 0 but when we calculate the the height of a tree the formula is
height of tree = 1 + max(leftTree height , rightTree height)
so height of tree = 1 + max(0,0) = 1 + 0 = 1
I hope now you understand , if you still have any doubts you can ask here
Thanks ! Happy Coding !