![]() |
CS 216 - Data Structures
Homework #2 |
NOTE: This work is to be done in pairs.
1. Implement ArrayStack, an array-based implementation of the SimpleStack interface.
2. Implement ArrayQueue, an array-based implementation of the SimpleQueue interface.
3. Implement ListStack, a singly-linked-list-based implementation of the SimpleStack interface.
4. Implement ListQueue, a singly-linked-list-based implementation of the SimpleQueue interface.
5. Implement SimpleStackTester, a stochastic test harness that probabilistically tests all SimpleStack cases. The constructor should take a SimpleStack to test, and the main method should test your ArrayStack and ListStack implementations.
6. Implement SimpleQueueTester, a stochastic test harness that probabilistically tests all SimpleQueue cases. The constructor should take a SimpleQueue to test, and the main method should test your ArrayQueue and ListQueue implementations.
7. In your README file, describe the tradeoffs between array and linked-list implementations in terms of time- and space-complexity, as well as software engineering considerations.