#include //#include #include "list.h" using namespace std; void main() { List l1, l2; int x; // build a couple of lists for (x = 0; x < 50; x += 7) l1.insertAtHead(x%10); for (x = 0; x < 50; x += 7) l2.insertInOrder(x%10); cout << "Original lists" << endl; cout << "list1: " << l1 << endl; cout << "list2: " << l2 << endl; cout << endl; cout << "Remove the first item from list 1" << endl; l1.removeHead(); cout << "List 1, one item shorter"; cout << "list1: " << l1 << endl; cout << "Remove the new first item from list 1" << endl; l1.removeHead(); cout << "list1: " << l1 << endl; cout << endl; cout << "Remove element 7 from list 2" << endl; l2.deleteInOrder(7); cout << l2 << endl; int key; do { cout << "Enter item to look for in list 2 (-1 quits)>"; cin >> key; if (key>=0) if (l2.search(key)) cout << "FOUND!\n"; else cout << "Not in list \n"; } while (key>=0); }