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 count the values less than n int subCountLessThan(int n, Node* subHead) const; // recursive sub-method to see if the list contains a value greater than or equal to m. bool subHasValueGreaterEqual(int m, Node* subHead) const; // recursive sub-method to see if the list contains a node directly preceded by a node containing // one third the value of the first node. bool subHasOneThirdValuePrior(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 countLessThan(n) returns the number of values in the given list that are less than n. // Note that "less 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 countLessThan(int n) const; // Method hasValueGreaterEqual(m) returns true if the list contains a value greater than or equal to m, false otherwise. // Note that "greater than or equal to" 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 hasValueGreaterEqual(int m) const; // Method hasOneThirdValuePrior() returns true if the list contains a node directly preceded by a node containing // one third of 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 hasOneThirdValuePrior() const; };