, , , , ,

[SOLVED] Cmsc204 assignment 3 double linked lists

$25

File Name: Cmsc204_assignment_3_double_linked_lists.zip
File Size: 376.8 KB

5/5 - (3 votes)

Your assignment is to write a generic double singly-linked list class with an iterator, and a generic sorted double singly-linked list class with an iterator that inherits from your generic double singly-linked list class. The GUI has been provided for you for this assignment to help you visualize your linked list. Your list classes will also be tested with Junit tests. Upload the initial files from Blackboard and your working files in a directory into the repository in GitHub you created in Lab 1 and take a screen shot of the files.

 

 

 

 

 

Exception handling

Generic Classes

Double Linked List

Ordered Double Linked List

Iterators

Comparators

 

 

 

 

 

 

BasicDoubleLinkedList

 

This generic double singly-linked list relies on a head (reference to first element of the list) and tail (reference to the last element of the list). Both the head and the tail are set to null when the list is empty. Both point to the same element when there is only one element in the list, and now the element’s “next” and “previous” references point to null. A node structure has only two fields: data and the next references. The class must only define the following entities: an inner class Node, an inner class that implements ListIterator (for the iterator method), head and tail references and an integer representing the list size. However only the next(), hasNext(), previous() and hasPrevious() methods of the ListIterator are you required to implement.  The rest of the methods can throw the UnsupportedOperationException, such as:

public void remove() throws UnsupportedOperationException{

throw new UnsupportedOperationException();}

All the entities are defined as protected so they can be accessed by the subclass.  Follow the Javadoc that is provided.

 

SortedDoubleLinkedList

A generic sorted double linked list will be constructed using a provided Comparator to determine how the list is to be sorted.  It extends BasicDoubleLinkedList class.  The addToFront and the addToEnd methods will not be supported and an add method will be added that inserts to the double linked list in sorted order dependent on the Comparator. Follow the Javadoc that is provided.

 

Exception Handling

 

GUI driver (provided for you)

          A GUI driver has been provided for you to help you visualize your doubly-linked lists. Here is the minimum that must be in place to start using the GUI driver effectively.

 

Testing

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Adding to a Basic List                                                                                                    Adding to a Sorted List

 

 

 

 

Removing Second from basic                                                                                                     Removing Thomas from sorted

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Start the iterators for Basic and Sorted. Think of iterators being “in between” nodes.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example of selecting “Next” for Basic and then for Sorted list. Think of iterators being “in between” nodes.

 

 

Example of “Next” for basic and “Previous” for Sorted. Think of iterators being “in between” nodes.

 

 

 

Deliverables / Submissions:

Design: UML class diagram with algorithm (pseudo-code) for methods

Implementation: Submit a compressed file containing the follow (see below):  The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below.  Be sure to review the provided project rubric to understand project expectations.  The write-up will include:

 

Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats:

 

This folder should contain Java source files only

 

Shopping Cart

No products in the cart.

No products in the cart.

[SOLVED] Cmsc204 assignment 3 double linked lists[SOLVED] Cmsc204 assignment 3 double linked lists
$25