Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. int height(Node* root)
  2. {
  3. if (root == 0) {return 0;}
  4. int a, b, c;
  5. a = 0; b = 0; c = 0;
  6. if (root->one) {a=height(root->one)+1;}
  7. if (root->two) {b=height(root->two)+1;}
  8. if (root->three){c=height(root->three)+1;}
  9. return max(a,b,c);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement