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,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.