#ifndef LIST_H_ #define LIST_H_ #include #include "MyNode.h" class List{ public: // default constructor: // POST: *this is an empty list List(); // destructor ~List(); // copy constructor List (const List& l); // assignment operator List& operator= (const List& l); // POST: key was added before first element of *this void push_front(int key); // POST: key was added after last element of *this void push_back (int key); // POST: the first occurrence of key was removed from *this // if *this does not contain key, nothing happened void remove (int key); // POST: returns const pointer to the first node const Node* get_head() const; // POST: the list was emptied void clear(); private: Node* head_; // PRE: *this is empty // POST: list starting at from was copied to *this void copy (const Node* from); }; // output operator std::ostream& operator<< (std::ostream& o, const List& l); #endif