0 votes 0 votes struct node* foo(struct node* a, struct node* b) { struct node* result, *rec; if(a==null) return b; else if(b==null) return a; else { rec=foo(a->next,b->next); result=a; a->next=b; b->next=rec; return result; } } Programming in C data-structures linked-list algorithms + – Vaishnavi01 asked Sep 17, 2018 recategorized Jul 6, 2022 by Lakshman Bhaiya Vaishnavi01 636 views answer comment Share Follow See 1 comment See all 1 1 comment reply Shaik Masthan commented Sep 17, 2018 reply Follow Share list1 :- 1 → 2 → 3 → 4 list2 :- 5 → 6 → 7 → 8 → 9 result:- 1 → 5 → 2 → 6 → 3 → 7 → 4 → 8 → 9 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes suppose there is only one linked list and a and b will go upto last and second last node and then swapping of last node and second last node will occur. Yash4444 answered Apr 26, 2021 Yash4444 comment Share Follow See all 0 reply Please log in or register to add a comment.