Home / Expert Answers / Computer Science / c-doubly-linked-list-double-linked-list-code-can-be-found-in-the-34-assignment5-c-34-intellij-projec-pa732

(Solved): C) Doubly Linked-List (double linked-list code can be found in the "Assignment5_C" IntelliJ project ...



C) Doubly Linked-List (double linked-list code can be found in the "Assignment5_C" IntelliJ project). Your task for Part C 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. The "main" method in the Assignment5_ class will test your BookFixedStack implementation, and will indicate pass/fail at each step.



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe