Guest User

Untitled

a guest
Jul 26th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1. int avh1(Tree t) {
  2.   if ( t.left == null && t.right == null ) {
  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