Loading src/edu/bu/ec504/hw2/BST.java +4 −4 Original line number Diff line number Diff line Loading @@ -49,13 +49,13 @@ public class BST<keyType extends Comparable<keyType> > { // METHODS // ... getters public final Integer getNodeId() { return nodeId; } public final int getNodeId() { return nodeId; } public final keyType getKey() { return key; } public BST<keyType> getLeft() { return left; } public BST<keyType> getRight() { return right; } // ... setters public final void setNodeID(Integer newId) { nodeId=newId; } public void setNodeID(int newId) { nodeId=newId; } public void setLeft(BST<keyType> newLeft) { left=newLeft; } public void setRight(BST<keyType> newRight) { left=newRight; } Loading Loading @@ -115,7 +115,7 @@ public class BST<keyType extends Comparable<keyType> > { * * @param prefix The current prefix for the subtree being printed */ final String toString(String prefix) { String toString(String prefix) { String result = ""; // output the key Loading @@ -132,6 +132,6 @@ public class BST<keyType extends Comparable<keyType> > { protected keyType key; // the key stored by this node protected BST<keyType> left; // the left child of this node protected BST<keyType> right; // the right child of this node private Integer nodeId; // the current node ID protected Integer nodeId; // the current node ID private static Integer nodeIdCounter=0; // a counter for node IDs } Loading
src/edu/bu/ec504/hw2/BST.java +4 −4 Original line number Diff line number Diff line Loading @@ -49,13 +49,13 @@ public class BST<keyType extends Comparable<keyType> > { // METHODS // ... getters public final Integer getNodeId() { return nodeId; } public final int getNodeId() { return nodeId; } public final keyType getKey() { return key; } public BST<keyType> getLeft() { return left; } public BST<keyType> getRight() { return right; } // ... setters public final void setNodeID(Integer newId) { nodeId=newId; } public void setNodeID(int newId) { nodeId=newId; } public void setLeft(BST<keyType> newLeft) { left=newLeft; } public void setRight(BST<keyType> newRight) { left=newRight; } Loading Loading @@ -115,7 +115,7 @@ public class BST<keyType extends Comparable<keyType> > { * * @param prefix The current prefix for the subtree being printed */ final String toString(String prefix) { String toString(String prefix) { String result = ""; // output the key Loading @@ -132,6 +132,6 @@ public class BST<keyType extends Comparable<keyType> > { protected keyType key; // the key stored by this node protected BST<keyType> left; // the left child of this node protected BST<keyType> right; // the right child of this node private Integer nodeId; // the current node ID protected Integer nodeId; // the current node ID private static Integer nodeIdCounter=0; // a counter for node IDs }