home page - news - syllabus - schedule - assignments - tutorials - java - references - Mike Jacobson |
Instructions - Assignment 1 - Assignment 2 - Assignment 3 - Assignment 4 |
Assignment 2: Stacks in Java |
Assignment #2 concerns material that has been introduced in this course on or before Monday, February 8.
The assignment is due by 11:59 PM on Monday, February 29 .
EXTENSION: the revised deadline is 11:59 PM on Wednesday, March 2
cpsc331Stack.java - Java interface describing a bounded stack ADT
A2Q5.input - sample input file for Question 5
A2Q5.output - sample output file for Question 5
The assignment has the following objectives.
to give you practice in writing “interfaces” that describe ADTS by writing your own and extening an existing interface;
to give you practice in implementing simple data structures (in this case, a bounded stack and a slightly modified version of a binary search tree) by implementing interfaces;
to use your stack interface, and the bounded stack data structure that implements it, to solve an appropriate problem (in this case, evaluating arithmetic expressions in Lisp).
Expected solutions: solution_2.pdf
Bounded stack interface: BoundedStack.java
Full stack exception class: FullStackException.java
Bounded stack array based implementation: BoundedArrayStack.java
Bounded stack linked list based implementation: BoundedLinkedStack.java
Invalid expression exception class: InvalidExpressionException.java
Solution to Question 5: A2Q5.java
Test cases for Question 6: A2Q6.input
Expected outputs for test cases for Question 6: A2Q6.output
Test cases for Question 6 (JUnit program): A2Q6.java
Please address any concerns or questions about the grading of this assignment to Mahshid Marbouti via D2L.
Last updated:
http://www.cpsc.ucalgary.ca/~jacobs/Courses/cpsc331/W16/assignments/assignment2.html |