Comp 388 lab 3 - linked lists

Goals

Overview

Consider my simple linked list demo, available at linkedlist.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).

There is also a C++ version, linkedlist.cpp. 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.