CS 216 - Data Structures
Homework #2 |
NOTE: This work is to be done in pairs.
1. Implement ArrayStack, an array-based implementation of the MyStack interface.
2. Implement ArrayQueue, an array-based implementation of the MyQueue interface.
3. Implement ListStack, a singly-linked-list-based implementation of the MyStack interface.
4. Implement ListQueue, a singly-linked-list-based implementation of the MyQueue interface.
5. Implement MyStackTester, a stochastic test harness that probabilistically tests all MyStack cases. The constructor should take a MyStack to test, and the main method should test your ArrayStack and ListStack implementations.
6. Implement MyQueueTester, a stochastic test harness that probabilistically tests all MyQueue cases. The constructor should take a MyQueue 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.