Question: Hi, could you please solve the question using Java Linked List 3 Linked List The following exercises deal with coding a LinkedList. The LinkedList is

Hi, could you please solve the question using Java Linked List

Hi, could you please solve the question using Java Linked List 3Linked List The following exercises deal with coding a LinkedList. The LinkedListis composed of generic Node objects. The LinkedList contains a Node head

3 Linked List The following exercises deal with coding a LinkedList. The LinkedList is composed of generic Node objects. The LinkedList contains a Node head referencing the first node in the list. The LinkedList contains a Node tail referencing the last node in the list. The LinkedList contains a method size() that returns the number of elements in the list. The Node objects are doubly-linked, and contain public variables next and prev, which reference the next and previous nodes in the list respectively. (10 points) Write a static method that takes in two sorted linked lists of integers and merges them into one sorted linked list and returns it. Since this a static method outside of Linkedlist, you cannot access the Nodes. You are allowed to remove items from listA and lists public static LinkedList merge(List lista, List listB) { (10 points) Write a method that reverses a doubly-linked LinkedList. This method will be an in- stance method for LinkedList, so you can use the Node head and tail references and refer to the LinkedList object using the this keyword. // You have access to the Node class public void reverse() {

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!