Skip to content

Commit 7d73991

Browse files
committed
cpp
1 parent e458b33 commit 7d73991

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Height of binary tree.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
int height(Node* root){
3+
// Your code here
4+
if(root==NULL){
5+
return 0;
6+
}
7+
int lh=height(root->left);
8+
int rh=height(root->right);
9+
return max(lh,rh) +1 ;
10+
}

0 commit comments

Comments
 (0)