两个链表隔空插入,哪位大神看看
struct st *And(struct st *A,struct st *B){
struct st *pa,*pb,*C,*pc;
C=(struct st *)malloc(sizeof(struct st));
pa=A->next;
pb=B->next;
C=pc=A;
while(pa)
{
pc->next=pb;
pc=pb;
pb=pb->next;
pa=pa->next;
pc->next=pa;
pc=pa;
}
pc->next=pb;
return(C);
}
不用排序的 输入1,2,3 4,5,6,输出1,4,2,5,3,6