Tree: Height of a Binary Tree
https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree/problem
int height(Node* root) {
if(!root) return -1;
return max(height(root->right),height(root->left))+1;
}
https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree/problem
Comments
Post a Comment