1 找到A的底层的指针Rnext或Lnext把B的头指针headb赋给Rnext或Lnext,
unitab(struct heada,struct headb)
{
while(*heada->Rnext)heada = Rnext;//加入右叉
heada->Rnext = headb;
}
2,结束条件是不再有交换发生。。标志um
void pxu(int a[])
{
int temp;
int um = 1;//交换标志
while(um){
um = 0;
for(int i=0;(i*2+2)<N;i++)//N数组的长度
{
if(a[i*2+1]>a[i*2+2])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
um = 1;
}
}
for(int i=0;(i*2+1)<N;i++)
{
if(a[i*2]>a[i*2+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
um = 1;
}
}
}
}
参考资料:C程序设计
本回答被提问者采纳