Question: java help 12. (15 points) Suppose we had a new type of LinkedList, called the SortedLinkedList, which is a linked list, but it keeps all

 java help 12. (15 points) Suppose we had a new type

java help

12. (15 points) Suppose we had a new type of LinkedList, called the SortedLinkedList, which is a linked list, but it keeps all the items in the list sorted. As a result, when we add an item to a SortedLinkedList, we don't provide an index, as the SortedLinkedList figures out where to put the new item based on the values already in the list Your task is is to complete the add method for a SortedLinkedList, shown below. This method inserts a new item into the SortedLinkedList in such a way that the list remains sorted. For example, if the list is 1,2,5 aud we call add (4), tlhe becoues 1.2,4.5] For simplicity: . You can use either a singly or doubly linked list. you can use , andto compare items, but if yotu remember how to use compareTo(), you can do so for extra credit . You may not call the add(int index, E item) method. You may not call the getNode() method (although you may rewrite it) public void add(E item)(

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!