9. Height of Binary Tree
My Approach
Time and Auxiliary Space Complexity
Code (C++)
class Solution {
public:
int height(struct Node* node) {
if (!node)
return 0;
return max(height(node->left), height(node->right)) + 1;
}
};Contribution and Support
Last updated