class List { private: class Node { public: int data; Node * next; Node (int data, Node *next) { Node::data = data; Node::next = next; } }; Node *head; // private copy method used by copy constructor and operator= void copy (const List &otherList); // private deleteAll method used by destructor and operator= void deleteAll(); // recursive sub-method to calculate the sum of values greater than n int subSumGreaterThan(int n, Node* subHead) const; // recursive sub-method to see if the list contains a value less than m. bool subHasValueLessThan(int m, Node* subHead) const; // recursive sub-method to see if the list contains a node directly followed by a node containing // double the value of the first node. bool subHasDoubleValueAfter(Node* subHead) const; public: // default contstructor: creates empty list List () { head = NULL; }; // copy constructor List (const List &otherList); // destructor: destroys list ~List (); // outputs list contents to cout void outputList () const; // adds a value at the beginning of the list void insert (int value); // assigns one linked list to another List& operator= (const List &otherList); // Method sumGreaterThan(n) returns the sum of the values in the given list that are greater than n. // Note that "greater than" refers to the contents (value) of the node *not* its position in the list. // If there are no values greater than n, this method returns 0. // This method does *not* change the list. int sumGreaterThan(int n) const; // Method hasValueLessThan(m) returns true if the list contains a value less than m, false otherwise. // Note that "less than" refers to the contents (value) of the node *not* its position in the list. // If there are no values in the list, this method returns false. // This method does *not* change the list. bool hasValueLessThan(int m) const; // Method hasDoubleValueAfter() returns true if the list contains a node directly followed by a node containing // double the value of the first node, and false otherwise. // If there are no values in the list, this method returns false. // This method does *not* change the list. bool hasDoubleValueAfter() const; };