Commit 79c5856e authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Fine-tuned tranform specs.

parent f3ab1023
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -50,17 +50,21 @@ public class BST<keyType extends Comparable<keyType> > {
     * Compute how to transform this BST into the BST <code>otherTree</code> using rotations.
     *
     * @param otherTree The into which we seek to transform the current tree.
     * @expects The keys of this object are {@link #equals(Object)}} to the keys of <code>otherTree</code>
     *          in a one-to-one correspondence.
     * @return An ArrayList of rotations indicating which rotations around which nodes
     * must be performed to transform <first> into <second.
     */
    public ArrayList<BstRotation> transformTo(BST otherTree) {
    public ArrayList<BstRotation<keyType> > transformTo(BST<keyType> otherTree) {
        throw new UnsupportedOperationException("This method should be properly implemented in a subclass.");
    }

    /**
     * Static version of {@link #transformTo(BST)}.
     * Only transforms a BST to another BST of the same key type.
     */
    public static ArrayList transform(BST firstTree, BST secondTree) {
    public static <oneKeyType extends Comparable<oneKeyType> > ArrayList
        transform(BST<oneKeyType> firstTree, BST<oneKeyType> secondTree) {
        return firstTree.transformTo(secondTree);
    }