The height of a tree is defined as the number of nodes on the longest path from the root to a leaf node. A leaf node is a node that does not have any children.
Topics
Companies
Articles
Examples:
Expected Time Complexity: O(n)
Expected Auxiliary Space: O(log n) for recursive calls.
Constraints:
1 <= number of nodes <= 10^5
0 <= node->data <= 10^5
Companies:
AmazonMicrosoftDE ShawFlipkartZoho
Topics:
Tree
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.