Fix broken code
This commit is contained in:
parent
6ec8285d20
commit
0033b66a11
1 changed files with 5 additions and 1 deletions
|
@ -24,8 +24,12 @@ public class AVLSearchTree<T extends Comparable<T>> extends SortedBinaryTree<T>
|
|||
|
||||
@Override
|
||||
protected int calcSize(TreeNode<T> p) {
|
||||
if (p == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return super.calcSize(p) + p.values.size() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the height of node t, or 0, if null.
|
||||
|
|
Loading…
Reference in a new issue