解
// 將A
Status ListCross_L(LinkList &A
{
LinkList pa
pa=A;
pb=B;
qa=pa;// 保存pa的前驅指針
qb=pb;// 保存pb的前驅指針
pa=pa
pb=pb
C=A;
while(pa&&pb){
if(pa
pt=pa;
pa=pa
qa
free(pt);
}
else
if(pa
pt=pb;
pb=pb
qb
free(pt);
}
else{
qa=pa;
pa=pa
}
}
while(pa){
pt=pa;
pa=pa
qa
free(pt);
}
while(pb){
pt=pb;
pb=pb
qb
free(pt);
}
pb=B;
free(pb);
return OK;
}
(
(
解
(
// A
Status ListCrossDelSame_Sq(SqList &A
{
int i=
while(i<A
if(A
else
if(A
else{
if(C
ListInsert_Sq(C
k++;
}
else
if(C
ListInsert_Sq(C
k++;
}
i++;
}
}
return OK;
}
(
// A
Status ListCrossDelSame_Sq(SqList &A
{
int i=
while(i<A
if(A
else
if(A
else{
if(k==
A
k++;
}
else
if(A
A
k++;
}
i++;
}
}
A
return OK;
}
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23405.html