Loading src/edu/bu/ec504/hw2/Main.java→src/Main.java +1 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ class Main { BST<String> strTest = new BST<>(strElements); System.out.println("Your int BST is:\n"+intTest); System.out.println("... right subtree:\n"+intTest.getRight()); System.out.println("Your string BST is:\n"+strTest); System.out.println("One rotation: "+new BstRotation(3, BstRotation.RotationType.ZAG)); Loading src/edu/bu/ec504/hw2/BST.java +10 −3 Original line number Diff line number Diff line Loading @@ -49,8 +49,15 @@ public class BST<keyType extends Comparable<keyType> > { // METHODS // ... getters final Integer getNodeId() { return nodeId; } final keyType getKey() { return key; } public final Integer getNodeId() { return nodeId; } public final keyType getKey() { return key; } public final BST<keyType> getLeft() { return left; } public final BST<keyType> getRight() { return right; } // ... setters public final void setNodeID(Integer newId) { nodeId=newId; } public final void setLeft(BST<keyType> newLeft) { left=newLeft; } public final void setRight(BST<keyType> newRight) { left=newRight; } /** * Compute how to transform this BST into the BST {@code otherTree} using rotations. Loading Loading
src/edu/bu/ec504/hw2/Main.java→src/Main.java +1 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ class Main { BST<String> strTest = new BST<>(strElements); System.out.println("Your int BST is:\n"+intTest); System.out.println("... right subtree:\n"+intTest.getRight()); System.out.println("Your string BST is:\n"+strTest); System.out.println("One rotation: "+new BstRotation(3, BstRotation.RotationType.ZAG)); Loading
src/edu/bu/ec504/hw2/BST.java +10 −3 Original line number Diff line number Diff line Loading @@ -49,8 +49,15 @@ public class BST<keyType extends Comparable<keyType> > { // METHODS // ... getters final Integer getNodeId() { return nodeId; } final keyType getKey() { return key; } public final Integer getNodeId() { return nodeId; } public final keyType getKey() { return key; } public final BST<keyType> getLeft() { return left; } public final BST<keyType> getRight() { return right; } // ... setters public final void setNodeID(Integer newId) { nodeId=newId; } public final void setLeft(BST<keyType> newLeft) { left=newLeft; } public final void setRight(BST<keyType> newRight) { left=newRight; } /** * Compute how to transform this BST into the BST {@code otherTree} using rotations. Loading