Advertisement
Guest User

Untitled

a guest
Jul 26th, 2012
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int avh1(Tree t) {
  2.   if ( t.left == Tree.EMPTY && t.right == TREE.EMPTY ) {
  3.     return 0;
  4.   }
  5.   else {
  6.     return (  t.left.leafCount*(avh1(t.left) + 1)
  7.             + t.right.leafCount*(avh1(t.right) + 1))
  8.           /  (t.left.leafCount() + t.right.leafCount());
  9.   }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement