#include "stdstuff.h" List::~List () { Node *t; while (head != NULL) { t = head; head = head -> next; delete t; } } void List::outputList () const { Node *c = head; int i = 0; cout << "The list contains:" << endl; while (c != NULL) { cout << " " << c -> data; if (++i == 10) { cout << endl; i = 0; } c = c -> next; } if (i != 0) cout << endl; } void List::insert (int data) { head = new Node (data, head); } // **** SOLUTION **** void List::duplicateGreaterValues (int value) { Node *c; c = head; while (c != NULL) { if (c -> data > value) { // node should be duplicated c -> next = new Node (c -> data, c -> next); // duplicate node c = c -> next; // leave c pointing to the duplicate } c = c -> next; // move on to next node } }