Question: question is on first page and you have to do solution by using the second page in that you have to write a code of

question is on first page and you have to do solution by using the second page in that you have to write a code of the question.  question is on first page and you have to do solution
by using the second page in that you have to write a

[Assignment] 1 - Lists Available from: Friday, 21 January 2022, 7:00 PM Due date: Friday, 28 January 2022, 7:00 PM Requested files: Solution.java (Download) Type of work: 8 Individual work Reduction by automatic evaluation: 2 Free evaluations: 10 In "Topic-2 Lists", you have learned linked lists and the basic operations of them. Let's do something useful! Suppose you are given two linked lists of integers, the values in which are non-decreasing (e.g., 1 -> 3 -> 5 and 2-> 4 -> 6). Try to implement a method to merge these two lists by splicing together their nodes so that we can get a sorted list that contains all elements (e.g., 1 -> 2 -> 3 -> 4 -> 5 -> 6). Inputs: the header nodes of two sorted linked lists; Outputs: the header node of the merged linked list. Note: The ListNode class is provided in the template file. Please keep it when you submit the code. Also, please don't modify other existing class/method headers in the template file. Hints: Consider edge cases (e.g., null inputs). 32 Editing 1 1 2 3 4 5 6 7 8 9 public class Solution 10 11 12 13 14 15 The definition for the linked list. DO NOT modity this class. */ public static class ListNode int value: ListNode next; ListNode (int value) this.value - value; 1 /* + The method for you to implement. DO NOT change the method header. */ public ListNode merge (ListNode 11, ListNode 12) // TODO return null; 3 I /** The main method is for test only and won't be evaluated. */ public static void main(String[] args) { Solution solution = new Solution (); ListNode a = new ListNode(1); ListNode b = new ListNode (2); ListNode nextA - a; ListNode nextB = b; for (int i = 1; i

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!