// // starter test program for doubly-linked-list class. // #include #include #include "dll.h" int main(void) { dll list1; cout << "list 1 (should be empty): " << list1 << endl; // insert into empty list. dll::link * newlink = list1.insert(list1.end(), 'a'); cout << "list 1 (should be 'a'): " << list1 << endl; // insert at start of list (ignoring return value). list1.insert(newlink, 'b'); cout << "list 1 (should be 'b a'): " << list1 << endl; // insert at end of list (ignoring return value). list1.insert(list1.end(), 'x'); cout << "list 1 (should be 'b a x'): " << list1 << endl; // insert into middle of list (using pointer to first // link inserted, which is now in the middle of the list). list1.insert(newlink, 'y'); cout << "list 1 (should be 'b y a x'): " << list1 << endl; return EXIT_SUCCESS; }