school/cs235/lab03/Student_Code/test.cpp
2016-04-06 20:46:10 -07:00

38 lines
915 B
C++

#include <iostream>
#include "linkedlist.h"
using namespace std;
int main() {
linkedlist l;
l.insertTail(69);
l.insertHead(28);
l.insertHead(1);
l.insertHead(2);
l.insertHead(4);
l.insertHead(30);
l.insertHead(15);
l.insertTail(68);
l.insertHead(9);
l.insertHead(0);
l.insertHead(7);
l.insertHead(42);
l.insertHead(3);
cout << l << endl;
l.insertAfter(13,30);
cout << l << endl;
l.remove(13);
cout << endl << l << endl << "removed 13" << endl;;
l.remove(4);
cout << endl << l << endl << "removed 4" << endl;;
l.remove(68);
cout << endl << l << endl << "removed 68" << endl;;
l.remove(3);
cout << endl << endl;
cout << endl << l << endl << "removed 3" << endl;;
l.remove(0);
cout << endl << l << endl << "removed 9" << endl;;
l.remove(69);
cout << endl << l << endl << "removed 69" << endl;;
}