Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There are five . java files in this folder, including: 1 . Student.java and Node.java are the two classes that we have used in class
There are five java files in this
folder, including:
Student.java and Node.java are the two classes that we have used in class during our discussion and implementation of linked list. You are required to implement a
genericLinkedList in this project with a set of required methods. If you are not
comfortable in moving to generic type directly, you can use those two classes to
implement the linkedlist with Student type item and then transfer it into generic in
the end. If you are comfortable to directly work on the generic type, then you do
not need to use those two classes in your project.
genericNode.java: in this file, you are going to implement a Node whose item is
generic type Based on the generic type discussion we had in class to translate the provide Node class to genericNode. genericNodes
functionality should be the same as Node except the difference of item type.
myGenericLinkedList.java: in this file, you are going to implement a generic type
linked list with a set of required methods. The method signature is already
provided, you only need to provide the implementation based on the requirement.
You will need to implement the genericNode before you work on this class.
mainClass.java: in this file, you are going to create an instance of
myGenericLinkedList and then test each of the required methods. You need to test
each of the required methods at least once.
myGenericLinkedList.java contains detailed requirements for each method. For clarity, you can find illustrations with examples for some of the required methods below. The following example is provided with the assumption that Student type is used to initialize the myGenericLinkedList instance.
insertE newItem : the insert method inserts a newItem with no duplicate allowed into the list in order. After the insertion, the list contains items in increasing order. For example, after inserts inserts inserts are called, the list is sss
merge myGenericLinkedList anotherList: this method will merge this list with
anotherList, since both lists are sorted, you are going to merge them so that the result is also a sorted list. For example, if this.list contains sss and anotherList contains ss then after the merge method is called, you will have
sssss
What to Submit:
genericNode.java
myGenericLinkedList.java
mainClass.java
Remarks:
Please do not modify myGenericLinkedList. Java other than provide implementation of the required methods. Do not change the provided method signature including return type
FIVE JAVA FILES ATTACHED IN PICTURES:
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