Question
can anyone help me with this : Linklist java Purpose The purpose of this assignment is to allow you to demonstrate basic knowledge of linked
can anyone help me with this :
Linklist java
Purpose
The purpose of this assignment is to allow you to demonstrate basic knowledge of linked lists, exceptions, and basic inheritance concepts (through interfaces). These operations include (directly or indirectly): inserting, deleting, finding and modifying, creating a sub-list, and "printing." This assignment should be done by you without outside help (other than from your instructor) -- if you are unable to complete this assignment in the allotted time, it is a strong indication you are not ready for the material in this class (or the APE if you have not received clearance) and you MUST meet with the instructor to discuss your continued enrollment in the class.
Specifics
The Java LinkedList class has a large variety of methods that let you perform any basic, non-data-related operation on the list. To ensure you understand how Java's LinkedList functions, you will implement all the methods listed in the Java API associated with LinkedList with the exclusion of the methods that are there as a result of the Deque interface, descendingIterator, listIterator, spliterator, and toArray(T[] a). For the purposes of this assignment, you may make any of the parameters shown in the API as E (which is used for generic representation) as type Object. Your class must implement the following interfaces (note that Java's LinkedList does as well): List, Serializable, Cloneable. For the excluded methods in your LinkedList class (descendingIterator, listIterator, spliterator, and toArray(T[] a)), note that you will still need to include implementations of them to satisfy the requirements of the interfaces you will implement. In the implementations for those methods, simply throw an UnsupportedOperationException.
While Java's LinkedList inherits from AbstractSequentialList, you are not allowed to do so as this would make your job *VERY* easy (and allow you to avoid the purpose of this assignment, which is to practice writing code that performs operations on a LinkedList).
Read the Java API documentation for each method your class requires. Design your methods so they follow the specifications of the Java API with regards to fundamental behavior, exceptions, and return values (where required).
LinkedList class additional requirements
also write roboust implementations of equals, toString, and hashCode methods (all of which are inherited from Object)
use a private nested Node class that is utilized by LinkedList *only*
use a dummy node for your LinkedList -- this will actually simplify the amount of code you need for many operations
your are welcome to use a singly linked list (which is expected) or you may use a doubly linked list (which will make some things simpler)
your list can be circular if you wish
you can use a head reference, a tail reference, or both if you wish
NOTE: Java's LinkedList uses a doubly linked list that is circular and utilizes a dummy/buffer node between the last and first element of the list. This representation provides for the best and most efficient functionality with regards to the methods of the class. It *greatly* simplifies the code for many of the methods
NOTE: Assume a starting index of 0 for all operations/methods that utilize an index(thus the last index in a list would be the current size minus one). This concurs with what is specified in the Java API for methods where this matters.
Include comments at the top of all source files that include your name and a description of the class(es) in the file. Be sure and describe (1) the implementation you used for your linked list (singly linked, doubly linked, circular, etc.) and (2) any shortcomings your solution has (e.g. methods that do not work properly/fully).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started