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