#ifndef LINKED_LIST_H #define LINKED_LIST_H #include using namespace std; class linked_list { public: // construct an empty list linked_list(); // appends given value to end of list void add(int data); // returns bracketed, comma-separated version of list string to_string() const; // returns true if list contains the given value bool contains(int value) const; // returns the number of elements in the list int size() const; // removes all elements of the list, leaving it empty void clear(); // copy constructor linked_list(const linked_list & rhs); // destructor ~linked_list(); // overloaded assignment operator linked_list & operator=(const linked_list & rhs); private: struct list_node; list_node * front; list_node * back; int count; void delete_nodes(list_node * current); void copy_from(list_node * other); }; #endif