You are viewing a single comment's thread. Return to all comments →
Program In C
int getHeight(struct Node* root) { int lCount = 0; int rCount = 0;
if(root->left != NULL) lCount = getHeight(root->left) + 1; if(root->right != NULL) rCount = getHeight(root->right) + 1; return (lCount > rCount) ? lCount : rCount;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 22: Binary Search Trees
You are viewing a single comment's thread. Return to all comments →
Program In C
int getHeight(struct Node* root) { int lCount = 0; int rCount = 0;
}