Comp 388 lab 3 - linked lists

Goals

Overview

Part 1: Consider my simple linked list demo, available at linkedstrlist.cs. You are to add the following methods to the class:

All the methods (except maybe the first) are O(n): you have to step through the list to position n. If you add a count_ field, then size() is O(1); otherwise it too is O(n).

Part 2: There is also a C++ version, linkedlist.cpp. It uses a template parameter T (in C# these are called generic type parameters). For this, I want you to implement a destructor, that calls delete() on each cell as it is being deallocated; this is done in lieu of garbage collection. However, you can skip reverse(). The complete list is
In C++, use NULL (or 0) instead of null.


To submit your project, create a zipfile and put it on Sakai or email it to me at pld@cs.luc.edu.