Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int avh1(Tree t) {
- if ( t.left == Tree.EMPTY && t.right == TREE.EMPTY ) {
- return 0;
- }
- else {
- return ( t.left.leafCount*(avh1(t.left) + 1)
- + t.right.leafCount*(avh1(t.right) + 1))
- / (t.left.leafCount() + t.right.leafCount());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement