/**
 * A two-ended list.  This is a hybrid of a stack and a queue; it contains 
 * objects, and one can insert or remove from either end as desired (but not 
 * the middle).
 *
 * You must not modify this interface.
 */

public interface TwoEndedList {

    /** 
     * Add o at the front of my list.
     *
     * @param Object o added to the front of my list.
     */

    public void addFront(Object o);

    /** 
     * Add o at the back of my list.
     *
     * @param Object o added to the back of my list.
     */

    public void addBack(Object o);
    
    /** 
     * Return the first object in my list.  If I am empty,
     * just return null.
     *
     * @return Object the first object in my list, null if I am empty.
     */

    public Object getFirst();

    /** 
     * Return the last object in my list.  If I am empty,
     * just return null.
     *
     * @return Object the last object in my list, null if I am empty.
     */

    public Object getLast();
    
    /** 
     * Remove and return the first object in my list.  If I am empty,
     * just return null.
     *
     * @return Object the first object in my list, null if I am empty.
     */

    public Object removeFirst();
    
    /** 
     * Remove and return the last object in my list.  If I am empty,
     * just return null.
     *
     * @return Object the last object in my list, null if I am empty.
     */

    public Object removeLast();
    
    /** 
     * Return the number of objects in my list.
     *
     * @return int the number of objects in my list.
     */

    public int size();
}
