Fix broken code

This commit is contained in:
Manuel Thalmann 2022-11-01 13:17:47 +01:00
parent 6ec8285d20
commit 0033b66a11

View file

@ -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;
}
}
/**