资源预览内容
第1页 / 共3页
第2页 / 共3页
第3页 / 共3页
亲,该文档总共3页全部预览完了,如果喜欢就下载吧!
资源描述
typedef structKeyType key;DataType;void InsertSort(DataType a,int n)/直接插入排序int i,j;DataType temp;for(i=0;i-1&temp.key-1&temp.keyaj+1.key)flag=1;temp=aj;aj=aj+1;aj+1=temp;void QuickSort(DataType a,int low,int high)/快速排序int i=low,j=high;DataType temp=alow;while(ij)while(ij&temp.key=aj.key)j-;if(ij)ai=aj;i+;while(ij&ai.keytemp.key)i+;if(ij)aj=ai;j-;ai=temp;if(lowi)QuickSort(a,low,i-1);if(ihigh)QuickSort(a,j+1,high);
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号