There are given two sorted linked lists consisting of nodes respectively.The task is to merge both lists and return the head of the merged list.
note that : the new linked list must be sorted too.
example test case:-
input:- List1: 5->10->15->40, List2: 2->3->20
Output: 2->3->5->10->15->20->40
There are given two sorted linked lists consisting of nodes respectively.The task is to merge both lists and return the head of the merged list. note that : the new linked list must be sorted too. example test case:- input:- List1: 5->10->15->40, List2: 2->3->20 Output: 2->3->5->10->15->20->40