欢迎来到天天文库
浏览记录
ID:6630655
大小:60.50 KB
页数:18页
时间:2018-01-20
《收集的比较全的各种排序算法》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、收集的比较全的各种排序算法packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassInsertSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publi
2、cvoidsort(int[]data){inttemp;for(inti=1;i0)&&(data[j]3、.0*/publicclassBubbleSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){inttemp;for(inti=0;ii;j--){if(data[j]4、-1);}}}}}选择排序:packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassSelectionSortimplementsSortUtil.Sort{/**(non-Javadoc)**@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*5、/publicvoidsort(int[]data){inttemp;for(inti=0;i>i;j--){if(data[j]6、m.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(inti=data.length/2;i>2;i/=2){for(intj=0;j7、tSort(data,j,i);}}insertSort(data,0,1);}/***@paramdata*@paramj*@parami*/privatevoidinsertSort(int[]data,intstart,intinc){inttemp;for(inti=start+inc;i=inc)&&(data[j]8、ackageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassQuickSortimplementsSortUtil.Sort{/*(non-Javadoc)*@s
3、.0*/publicclassBubbleSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){inttemp;for(inti=0;ii;j--){if(data[j]4、-1);}}}}}选择排序:packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassSelectionSortimplementsSortUtil.Sort{/**(non-Javadoc)**@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*5、/publicvoidsort(int[]data){inttemp;for(inti=0;i>i;j--){if(data[j]6、m.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(inti=data.length/2;i>2;i/=2){for(intj=0;j7、tSort(data,j,i);}}insertSort(data,0,1);}/***@paramdata*@paramj*@parami*/privatevoidinsertSort(int[]data,intstart,intinc){inttemp;for(inti=start+inc;i=inc)&&(data[j]8、ackageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassQuickSortimplementsSortUtil.Sort{/*(non-Javadoc)*@s
4、-1);}}}}}选择排序:packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassSelectionSortimplementsSortUtil.Sort{/**(non-Javadoc)**@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*
5、/publicvoidsort(int[]data){inttemp;for(inti=0;i>i;j--){if(data[j]6、m.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(inti=data.length/2;i>2;i/=2){for(intj=0;j7、tSort(data,j,i);}}insertSort(data,0,1);}/***@paramdata*@paramj*@parami*/privatevoidinsertSort(int[]data,intstart,intinc){inttemp;for(inti=start+inc;i=inc)&&(data[j]8、ackageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassQuickSortimplementsSortUtil.Sort{/*(non-Javadoc)*@s
6、m.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(inti=data.length/2;i>2;i/=2){for(intj=0;j
7、tSort(data,j,i);}}insertSort(data,0,1);}/***@paramdata*@paramj*@parami*/privatevoidinsertSort(int[]data,intstart,intinc){inttemp;for(inti=start+inc;i=inc)&&(data[j]8、ackageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassQuickSortimplementsSortUtil.Sort{/*(non-Javadoc)*@s
8、ackageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassQuickSortimplementsSortUtil.Sort{/*(non-Javadoc)*@s
此文档下载收益归作者所有