You are viewing a single comment's thread. Return to all comments →
simple c++ recursive solution
int height(Node* root) { if(root==NULL){return -1;} else{ int left = height(root->left); int right = height(root->right); return max(left,right)+1; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Height of a Binary Tree
You are viewing a single comment's thread. Return to all comments →
simple c++ recursive solution