The Gateway to Computer Science Excellence
0 votes
117 views
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;

}

}
in Programming by (143 points) | 117 views
0

list1 :- 1 → 2 → 3  → 4

list2 :- 5 → 6 → 7  → 8  → 9

 

result:- 1 → 5 → 2 → 6 → 3  → 7 → 4 → 8  → 9

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,429 answers
195,205 comments
99,906 users