欢迎来到天天文库
浏览记录
ID:58426984
大小:12.00 KB
页数:1页
时间:2020-09-03
《实现顺序表元素的冒泡排序.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#defineMAXSIZE100typedefstruct{intkey;intother;}RecordType;typedefstruct{RecordTyper[MAXSIZE+1];intlength;}seqlist;voidBubblesort(seqlist*L){inti,j,n,change;RecordTypex;n=L->length;change=1;for(i=0;ir[j].key>L->r[j+1].key){x=L->r
2、[j];L->r[j]=L->r[j+1];L->r[j+1]=x;change=1;}}}voidmain(){seqlistL,*p=&L;inti;L.length=8;for(i=0;i
此文档下载收益归作者所有