几种排序法的头文件

上传人:平*** 文档编号:11991322 上传时间:2017-10-16 格式:DOC 页数:3 大小:27.17KB
返回 下载 相关 举报
几种排序法的头文件_第1页
第1页 / 共3页
几种排序法的头文件_第2页
第2页 / 共3页
几种排序法的头文件_第3页
第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);

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号