We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
For anyone having problem in sample test case. Please note down that they have considerd height of root as '-1'.
So your program should return '-1' when root is NULL.
Tree: Height of a Binary Tree
You are viewing a single comment's thread. Return to all comments →
For anyone having problem in sample test case. Please note down that they have considerd height of root as '-1'. So your program should return '-1' when root is NULL.