CSci 581-01: Special Topics in Computer Science
Object-Oriented Design & Programming
Fall Semester 1997

Assignment #5 (Revised)
Due Midnight, Tuesday, 11 November


This is similar to Exercise 1 in chapter 9 of the Budd textbook (page 178).

  1. Take the Java code for the LinkedList class from Chapter 8 of the Budd textbook ( retrieve the code from the from FTP site?) and rename it to be class List. Format and document the code appropriately, but do not modify it otherwise. (You are not required to show your testing output for List, but you are expected to do so for the remaining classes.)

  2. Using inheritance from the List class, design and implement class StackIsList. This subclass must implement an unbounded stack ADT with operations similar to the stack ADT defined in your instructor's lecture notes on Data Abstraction. (You do not need to include the full or destroy methods but include the other methods with the same signatures.) Make the implementation more robust than the code in the Data Abstraction lecture notes. Format, document, and test the class appropriately.

  3. Now using composition (i.e., aggregation) and building on the List class, implement class StackHasList. This class must also implement the unbounded stack ADT as described above. Format, document, and test the class appropriately.

  4. Again using inheritance, but this time extending class java.util.Vector (in the Java API), implement a class StackIsVector for the unbounded stack ADT. Format, document, and test the class appropriately.

  5. Again using composition, but this time building on class java.util.Vector, implement a class StackHasVector for the unbounded stack ADT. Format, document, and test the class appropriately.

  6. Answer the question: Which implementation technique seems more appropriate in this case?

  7. Submit a paper listing of your code, testing output, and answer to the question by the due date.

  8. Also send email copies of your source code to cs581@hal.cs.olemiss.edu.


UP to CSci 581 Assignments page?


Copyright © 1998, H. Conrad Cunningham
Last modified: 12 January 1998.