#include #include "ListT.h" using namespace std; template void PrintList(ListT & l) { l.Home(); for (int i = 0; i < l.Size(); i++) { cout << l.Get() << " "; l.Next(); } cout << endl; } void IntTest(); void StringTest(); int main() { IntTest(); StringTest(); return 0; } void StringTest() { ListT list; list.Insert("Hello"); list.Home(); list.Insert("World"); PrintList(list); list.Home(); list.Delete(); PrintList(list); list.Home(); list.Delete(); PrintList(list); list.Home(); list.Insert("A"); list.Home(); list.Insert("B"); list.Insert("C"); list.Insert("D"); PrintList(list); list.Home(); list.Next(); list.Delete(); PrintList(list); list.Home(); list.Next(); list.Next(); list.Delete(); PrintList(list); } void IntTest() { ListT intList; cout << " inserting 1" << endl; intList.Insert(1); PrintList(intList); cout << endl; cout << "inserting 2" << endl; intList.Home(); intList.Insert(2); PrintList(intList); cout << endl; cout << "Inserting 3" << endl; intList.Home(); intList.Next(); intList.Insert(3); intList.Insert(4); intList.Home(); intList.Insert(5); intList.Home(); intList.Next(); intList.Insert(6); PrintList(intList); cout << endl; }