CSCI 151 - Data Structures and Object-Oriented Development
Spring 2015
Lab 6: Linked-list implementation of stacks
- In this lab, we will develop a singly-linked-list implementation of
stacks.
- Download the provided code.
- Unpack the code into the same Eclipse Java project as Lab 5.
- The code includes the following files:
-
numstack.timetest package
-
TimeTest.java: Run this file to compare the performance of ArrayIntStack and ListIntStack.
-
numstack.model package
-
ListIntNode.java: This is the first of two files you will modify for this assignment. You will need to complete the constructor and the toString() method.
-
ListIntStack.java: This is the second of two files you will modify for this assignment. You will use a sequence of ListIntNode objects to implement a stack.
-
ListIntStackTest.java: Run this file to see the
results of the unit tests for your ListIntStack
implementation.
Grading
To earn an A on this lab, you must:
- Pass all seven unit tests.
- Write a short document (via text box in the Moodle Lab 6 submission)
comparing the running times of
ArrayIntStack and ListIntStack using TimeTest.
- To earn an A+, you should rerun
TimeTest with 104,
105, and 107 items, and analyze the results in your
document.
If you elect not to conduct the time tests, or if any of the unit tests fail,
your grade will be determined as follows:
| Number of Unit Tests Passed | Grade |
| 7 | B |
| 6 | C |
| 4 | D |