#define MAXSIZE 100
typedef struct
{
int key;
int other;
}RecordType;
typedef struct
{
RecordType r[MAXSIZE+1];
int length;
}seqlist;
void Bubblesort(seqlist *L)
{
int i,j,n,change;
RecordType x;
n=L->length;change=1;
for(i=0;i change=0; for(j=0;j {x=L->r[j];L->r[j]=L->r[j+1];L->r[j+1]=x;change=1; } } } void main() { seqlist L,*p=&L; int i;L.length=8; for(i=0;i printf(\"原数据:\"); for(i=0;i Bubblesort(p); printf(\"\\n排序后:\"); for(i=0;i printf(\"\\n\"); } 因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- xiaozhentang.com 版权所有 湘ICP备2023022495号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务