// List.H // // Defines a LinkedList implementation of the List ADT #ifndef _LinkedList_H #define _LinkedList_H #include // For NULL // List class // // CONSTRUCTION: with no initializer // Access is via ListItr class // // ******************PUBLIC OPERATIONS********************* // boolean isEmpty( ) --> Return true if empty; else false // void makeEmpty( ) --> Remove all items // ListItr zeroth( ) --> Return position to prior to first // ListItr first( ) --> Return first position // void insert( x, p ) --> Insert x after current iterator position p // void remove( x ) --> Remove x // ListItr find( x ) --> Return position that views x // ListItr findPrevious( x ) // --> Return position prior to x // ******************ERRORS******************************** // No special errors template class List { public: List( ); List( const List & rhs ); ~List( ); bool isEmpty( ) const; void makeEmpty( ); ListItr zeroth( ) const; ListItr first( ) const; void insert( const Object & x, const ListItr & p ); ListItr find( const Object & x ) const; ListItr findPrevious( const Object & x ) const; void remove( const Object & x ); const List & operator=( const List & rhs ); private: ListNode *header; }; #endif