Assignment2CreatingADTsAndDataStructureImplementations (1)
Assignment2CreatingADTsAndDataStructureImplementations (1)
Structures
Description
In this assignment, you’ll work in groups to write your own ADTs for a stack and a queue, and
then create working versions of an arraylist, a doubly linked list, a stack and a queue using the
Test-Drive Development approach of testing your implementations.
Instructions
This assignment consists of three parts, to be completed outside of class time. See the course
outline and Brightspace for due dates. Complete this assignment with your assigned group.
3. Implement your utility classes for an arraylist, doubly linked list, a stack and a queue.
There are two submission folders for this assignment. The requirements for each submission
are outlined in the Submission Deliverables section of this document. Each of the two
submissions has a separate due date. See Brightspace for exact due dates.
Assignment Specifications
Important: Read the specifications very carefully. If you are uncertain about any of the
requirements, discuss it with your instructor.
1. Write your own StackADT.java and QueueADT.java interface with all the required
functionalities as method stubs with appropriate pre-conditions, post-conditions,
parameters, return values and expected exceptions using proper Javadoc notations.
Note: These 2 files are the only requirements for submission 1.
2. Create a complete set of JUnit tests in a class called MyArrayListTests.java based on the
supplied ListADT.java and Iterator.java interfaces.
Note: Ensure all tests fail before moving to the next step.
3. Write an implementation for the utility class MyArrayList.java using the supplied
ListADT.java and Iterator.java interfaces using an array as the underlying data structure to
store the elements in this list.
Note: You can NOT modify the ADTs provided in any way!
4. Completely test the implementation of MyArrayList.java for correct functionality using the
set of JUnit test from the previous step.
5. Repeat steps 2–4 for the utility class MyDLL.java using a linked list as the underlying data
structure to store each element in a node, based on the same ListADT.java and
Iterator.java interfaces provided by your instructor.
a. Your implementation should also include a MyDLLNode.java class.
b. Name the complete set of JUnit test functions MyDLLTests.java.
Note: If you’re following the TDD approach correctly and have created JUnit tests against
the ListADT interface, the same tests apply to your DLL as well!
6. After the due date of submission 1, submission 2 will be released with the ADTs you will
need for the following steps.
Warning
Implement this project using ONLY the libraries that you developed for the MyStack, MyQueue,
MyArrayList and MyDLL.
The exception is using the Arrays.copyOf() or System.arraycopy() methods to resize your array
in MyArrayList, the toArray methods and the Iterator implementations. You are also allowed to
use any of the standard exceptions in the Java library such as NullPointerException and
NoSuchElementException.
You will be penalized 50% of your final mark for the assignment if you use the java classes
from the java.util.*, or similar packages beyond the exceptions listed above. If you’re unsure,
discuss it with your instructor.
Submission Deliverables
Submission 1: Stack and Queue ADTs (16 marks)
Your group’s submission should include a zipped folder which includes the following items and
nothing else:
1. Your StackADT.java
2. Your QueueADT.java
Note: Although you do not need to submit it at this time, you may want to review the Marking
Criteria document to make sure you have completed this submission correctly.
Upload your group’s .zip file to Brightspace by the specified due date and time.
1) Your completed javadoc using the “-private” option when generated, and the output
placed in the doc directory of the project.
2) A folder containing the complete Eclipse project directory.
3) The completed Marking Criteria document containing your group’s evaluation of your
application.
Name your group’s assignment submission folder as your group name followed by the
assignment number (e.g., A2-2Group3.zip).
Upload your group’s .zip file to Brightspace by the specified due date and time.