Commit c46d0fb2 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

minor structural improvements

parent 4bad0795
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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; }

@@ -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
@@ -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
}