(
(
解
(
// A
Status ListCrossDelSame_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{
if(pa
pt=pa;
pa=pa
qa
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_L(LinkList &A
{
LinkList pa
pa=A;
pb=B;
qa=pa;// 保存pa的前驅指針
qb=pb;// 保存pb的前驅指針
pa=pa
pb=pb
while(pa&&pb){
if(pa
pt=pa;
pa=pa
qa
free(pt);
}
else
if(pa
pt=pb;
pb=pb
qb
free(pt);
}
else{
if(pa
pt=pa;
pa=pa
qa
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;
}
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23406.html