Answered step by step
Verified Expert Solution
Link Copied!

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:
1. 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.
2. 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.
3. 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.
4. 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.
1. insert(E 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 insert(s3), insert(s1), insert(s2) are called, the list is s1->s2->s3
2. 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 s1->s3->s4 and anotherList contains s2->s5, then after the merge method is called, you will have
s1->s2->s3->s4->s5
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:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions