interface Container extends Cloneable {

    /** Return the number of contained objects */
    int size();

    /** Return true if no objects in container */
    boolean empty();

    /** Return true if given object is in container
        (using Object.equals()) semantics */
    boolean contains(Object obj);

    /** Remove all elements from container */
    void clear();

    /** Return an enumeration over contained objects */
    java.util.Enumeration elements();
}


interface Stack extends Container {

    /** Add object to top of stack */
    void push(Object obj);

    /** Remove and return object at top of stack, or null if empty */
    Object pop();

    /** Return object at top of stack, or null if empty */
    Object peek();
}


interface Queue extends Container {

    /** Add object to tail of queue */
    void enqueue(Object obj);

    /** Remove and return object at head of queue */
    Object dequeue();
}


interface BinaryTree extends Container {

    /** Add object to tree (must supported ordered comparison) */
    void add(Comparable obj);	// interface Comparable from Exercise 4.2

    /** Return enumeration over contained objects in ascending order */
    java.util.Enumeration elementsInOrder();

    /** Return enumeration over contained objects in descending order */
    java.util.Enumeration elementsInReverseOrder();
}
