CS 112
Homework 8
Due: Wednesday April 6, 2005
by 12:00 a.m.
Part I. The LinkedList class
- Complete the LinkedList class that you started in the lab (following the handout). Test it using a
menu-based application. Make sure you also test it on "bad" cases, where it will be forced to throw exceptions. Include a
typescript with your submission, to show how you tested the class.
Part II. A Doubly-Linked List class
- Extend the LinkedList class into a DoubleLinkedList class. This should have (roughly) the functionality of the
Java LinkedList class, in the sense that it can be traversed from both ends. You do not have to implement all the methods from
the Java LinkedList class (such as methods which allow you direct access to an element given by an index). Test it using a
menu-based application, extending what you've done in Part I.
Part III. Applying the List Class
Do each of the exercises described below in a separate subdirectory. In each case, you will start by copying the solution from
a previous homework, then replace an old class with a new one, as described.
- Re-implement the Stack and Queue classes using linked lists, rather than arrays, and test them with the testdrivers from
previous Hwks 6 and 7.
- Re-compile the Calculator applet to use the new stack.
Ileana Streinu