diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java b/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java index e226342..768e99f 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java @@ -19,7 +19,7 @@ public class AVLSearchTree> extends SortedBinaryTree @Override protected int calcSize(TreeNode p) { // TODO Implement (6.2) - throw new RuntimeException(); + return super.calcSize(p); } /** @@ -43,14 +43,18 @@ public class AVLSearchTree> extends SortedBinaryTree } else if (height(p.left) - height(p.right) == 2) { if (height(p.left.left) >= height(p.left.right)) { // TODO Implement (6.2) + rotateR(p); } else { // TODO Implement (6.2) + rotateLR(p); } } else if (height(p.right) - height(p.left) == 2) { if (height(p.right.right) >= height(p.right.left)) { // TODO Implement (6.2) + rotateL(p); } else { // TODO Implement (6.2) + rotateRL(p); } } p.height = Math.max(height(p.left), height(p.right)) + 1;