Question: Double Linked - Lists ( 1 0 0 pts ) A ) Doubly Linked - List ( double linked - list code can be found

Double Linked-Lists (100 pts)
A) Doubly Linked-List (double linked-list code can be found in the "Assignment5_C" IntelliJ project).
Your task for Part A is to fully implement the "FishLinkedList" class. The FishLinkedList class is a
doubly linked-list that holds Fish objects. The start of the doubly linked-list is "head", the end is
"tail".
The fixed stack methods that need to be implemented are as follows:
private boolean contains(Fish fish)
Returns true if the Fish parameter "fish" is already in the doubly linked-list, false if not.
public boolean addFirst(Fish fish)
Adds the Fish parameter "fish" to the beginning of the linked list unless that fish is already
in the doubly linked-list. Return true if the Fish is added, false if the Fish was not added
because it is already in the list.
public boolean addLast(Fish fish)
Adds the Fish parameter "fish" to the end of the linked list unless that fish is already in
the doubly linked-list. Return true if the Fish is added, false if the Fish was not added
because it is already in the list.
public boolean add(int index, Fish fish)
Adds the Fish parameter "fish" to the linked list at the specified "index", unless that index
is beyond the end of the doubly linked-list or that fish is already in the doubly linked-list.
Return true if the Fish is added, false if the index is beyond the end of the doubly linked-
list or if it is already in the list.
public Fish removeFirst()
Remove and return the first Fish in the doubly linked-list. Return null if the list is empty.
public Fish removeLast()
Remove and return the last Fish in the doubly linked-list. Return null if the list is empty.
public Fish remove(int index)
Remove and return the Fish at the specified "index". Return null if the index is beyond
the end of the doubly linked-list or if the list is empty.
public Fish get(int index)
Return (but do not remove) the Fish at the specified "index". Return null if the index is
beyond the end of the doubly linked-list or if the list is empty.
 Double Linked-Lists (100 pts) A) Doubly Linked-List (double linked-list code can

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!