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

added a useful helper function

parent c46d0fb2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public class BST<keyType extends Comparable<keyType> > {
    public void setNodeID(int newId) { nodeId=newId; }
    public void setLeft(BST<keyType> newLeft) { left=newLeft; }
    public void setRight(BST<keyType> newRight) { left=newRight; }
    public static void resetNodeIDCounter() { nodeIdCounter=0; }

    /**
     * Compute how to transform this BST into the BST {@code otherTree} using rotations.