CS 112
Lab 19
List implementation of Stacks
Implement a Stack abstract data type using a linked list (instead
of an array).
- Copy the IntStack.h, IntStack.cpp, makefile and test
driver from your Hw5 or from here.
- Modify what is necessary: the private part in the header file,
the implementation file, and maybe the test driver
(no need to test the stack becoming full, although you can if you wish so.)
References and how to proceed
- Create a directory Lab19.
Copy the IntStack.h, IntStack.cpp, makefile and test driver from
Hw5. Modify what is necessary: the private part in the header file,
the implementation file, and maybe the test driver (no need to test the
stack becoming full, although you can if you wish so.)
- Copy the IntList.cpp, IntList.h from your Hw8. Modify the
Makefile to compile it, too.
- Test the new stack with the same testdriver you used for the
stack implemented as an array.
- Prepare the typescript, then submit ALL the files.
The purpose of this homework is to illustrate code reuse and
the advantages of an object-oriented design of a program, whereas changing
the implementation of a class should not affect the implementation of the
programs which used objects/methods from that class.
To submit
Submit in Lab19 all the files: sources, Makefile, a
typescript and a data file with your test data.
See below for naming conventions.
Naming conventions and files to submit (in Lab19):
- List of integers: IntList.cpp, IntList.h
- Stack of integers: IntStack.cpp, IntStack.h
- Test driver: testStack.cpp
- Makefile
- Data file: data
- typescript
Submit in Lab19, by midnight, all the files that are necessary for
compiling, executing and proving the correctness of your code:
header and implementation
files, testdriver, makefile and a typescript.
Ileana Streinu