/** * ADT: DequeIdea * Description: The idea for a Deque structure * Notes: * 1) Also see super-ADT * 2) The (inherited) "add" method does an "addLast" * 3) The (inherited) "toNativeList" returns list in first to last order */ //Super (Parent) ADT: SpecializedStructureIdea (all methods in super are inherited by DequeIdea) ADT: DequeIdea { //--------------------- Accessing --------------------- /** * Returns first element If list is empty, throws exception: "(first) Attempted to access element in empty list" */ first(); /** * Returns last element If list is empty, throws exception: "(last) Attempted to access element in empty list" */ last(); //--------------------- Adding --------------------- /** * Adds the passed element to start of list */ addFirst(newElem); /** * Adds the passed element to end of list */ addLast(newElem); //--------------------- Removing --------------------- /** * Removes first element * Returns removed element If list is empty, throws exception: "(removeFirst) Attempted to access element in empty list" */ removeFirst(); /** * Removes last element * Returns removed element If list is empty, throws exception: "(removeLast) Attempted to access element in empty list" */ removeLast(); }