SHARE
TWEET

Untitled

a guest Jul 26th, 2012 48 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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top