Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int height(Node* root)
- {
- if (root == 0) {return 0;}
- int a, b, c;
- a = 0; b = 0; c = 0;
- if (root->one) {a=height(root->one)+1;}
- if (root->two) {b=height(root->two)+1;}
- if (root->three){c=height(root->three)+1;}
- return max(a,b,c);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement