We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e458b33 commit 7d73991Copy full SHA for 7d73991
Height of binary tree.cpp
@@ -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