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(); // returns the sum of the values of the sublist int subSumValues(Node *subHead) const; // returns the number of values in the sublist int subNumValues(Node *subHead) const; // returns true if the values of the sublist are sorted // in ascending order, false otherwise bool subIsSortedAscending(Node *subHead); 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); // returns the sum of the values of the list int sumValues() const; // returns the number of values in the list int numValues() const; // returns true if the values of the list are sorted // in ascending order, false otherwise bool isSortedAscending(); };