Go back to Challenges list
Merge Linked Lists
Complete the merge() function that takes two linked lists and merges them to make a single list, taking nodes alternately from the supplied lists. If either list runs out, take all the remaining nodes from the other list.
Input Format
Your function gets two linked listsOutput Format
Return the new listSample Input
5
1 3 5 7 9
4
2 4 6 8
Sample Output
1 2 3 4 5 6 7 8 9
Memory Limit
512M