# include
Typedef struct LNode
{int data;
struct LNode *next;
} LinkNode;
Int a1 [50], a2 [50].
Void CreateList (LinkNode * & L, int a [], int n)
{LinkNode * s * r;
int i;
L=(LinkNode *) malloc (sizeof (LinkNode));
L -> next=NULL;
R=L;
For (I=0; i
S -> data=https://bbs.csdn.net/topics/a [I];
R -> next=s;
R=s;
}
R -> next=NULL;
}
Void seperate (LinkNode * & L1, LinkNode * & L2)
{
LinkNode * L, * p, * q * r * m;
L=(LinkNode *) malloc (sizeof (LinkNode));
L -> next=NULL;
P=L1 -> next;
Q=L2 -> next;
R=L;
while(p!=NULL & q!=NULL) {
If (p -> data
data) {
R -> next=p;
R=p;
p=p->next;
}
Else if (p -> data=https://bbs.csdn.net/topics/=q-> data) {
R -> next=p;
R=p;
R -> next=q;
R=q;
p=p->next;
q=q->next;
}
The else {
R -> next=q;
R=q;
q=q->next;
}
}
while(p!=NULL) {
R -> next=p;
R=p;
p=p->next;
}
While (q!=NULL) {
R -> next=q;
R=q;
q=q->next;
}
R -> next=NULL;
M=L -> next;
While (m!=NULL) {
Printf (" % d ", the m -> data);
M=m -> next;
}
}
Int main ()
{
LinkNode * L1, L2,
Int I, n1, and n2;
The scanf (" % d % d ", & n1, and n2);
For (I=0; IThe scanf (" % d ", & a1 [I]);
For (I=0; IThe scanf (" % d ", & a2 [I]);
CreateList (L1, a1, n1);
CreateList (L2, a2, n2);
Seperate (L1 and L2);
return 0;
}