For this Question: Given two sorted linked list of size s1 and s2(sizes may or may not be same), your task is to merge them such that resultant list is also sorted.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>Merge()</b> that takes the head node of both the linked list as the parameter.
Use <b>insert()</b> function for inserting nodes in the linked list.

<b>Constraints:</b>
1 < =  s1, s2 < = 1000
1 < =  val < = 10000Return the head of the merged linked list, printing will be done by the driver codeSample Input:
5 6
1 2 3 4 5
3 4 6 8 9 10

Sample Output:
1 2 3 3 4 4 5 6 8 9 10, I have written this Solution Code: public static Node Merge (Node head1, Node head2){
    Node head =null;
    while(head1!=null && head2!=null){
     if(head1.val<head2.val){
         head=insert(head,head1.val);
         head1=head1.next;
     }   
     else{
         head=insert(head,head2.val);
         head2=head2.next;
         
     }
    }
    while(head1!=null){
        
         head=insert(head,head1.val);
        head1=head1.next;
    }
    while(head2!=null){
        head=insert(head,head2.val);
        head2=head2.next;
    }
    return head;
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?