Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Create a generic class called GenLinkedList. GenLinkedList will use nodes that store a value of the generic type to store its contents. It should...

Create a generic class called GenLinkedList. GenLinkedList will use nodesthat store a value of the generic type to store its contents.It should have the following methods. The methods should all operate on the object making the call (none are static). Perform checking of the parameters and throw exceptions where appropriate.The linked list should be singly-linked.It should not use sentinel nodes (empty header and tail nodes). You should strive for an efficient implementation of each method.Methodsi. shiftreceives an integer as a parameter, and shifts the list forward orbackward this number of nodes, provided it is within the current sizej. erase receives an index position and number of elements as parameters, andremoves elements beginning at the index position for the number of elements specified, provided the index position is within the sizeand together with the number of elements does not exceed the sizek. insertListreceives a generic List (a Java List) and an index position as parameters, and copies each value of the passed list into the current list startingat the index position, provided the index position does not exceed the size.For example, if list has a,b,c and another list having 1,2,3 is inserted atposition 2, the list becomes a,b,1,2,3,c

As the description above states. I'm working on an assignment in Java for a generic singly linked list.

I have most of the other methods for this assignment figured out, but I'm currently struggling with the three methods listed above (Shift, Erase, and InsertList).

I have no idea how to approach it so any help would be greatly appreciated.

If there's anything that may be required of me in order for you to help me, please let me know.

import java.util.ArrayList;import java.util.List;import java.util.NoSuchElementException;public class GenLinkedList<T> {private Node head;private Node tail;int size = 0;private static...
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question