← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given two singly linked lists, merge them by inserting nodes of the second list into the first list at alternate positions. If the second list is longer, the remaining nodes are left in the second list; if the first list is longer, its remaining nodes stay untouched. You must perform the merge in-place (only pointer changes, no new nodes) and return the modified first list (head1) and whatever is left of the second list (head2).