欢迎来到天天文库
浏览记录
ID:15614428
大小:46.50 KB
页数:18页
时间:2018-08-04
《收集的比较全的各种排序算法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
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[
2、])*/publicvoidsort(int[]data){inttemp;for(inti=1;i0)&&(data[j]3、10-11-22*@version1.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]){SortUtil.swap(data,j,j-1);}}}}}选择排序:packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassSelectionSortimplementsSortUtil.Sort{/**(non-Javadoc)**@seeorg.rut.util.5、algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){inttemp;for(inti=0;i>i;j--){if(data[j]6、algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(7、inti=data.length/2;i>2;i/=2){for(intj=0;j=inc)&&(data8、[j]
3、10-11-22*@version1.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]){SortUtil.swap(data,j,j-1);}}}}}选择排序:packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassSelectionSortimplementsSortUtil.Sort{/**(non-Javadoc)**@seeorg.rut.util.5、algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){inttemp;for(inti=0;i>i;j--){if(data[j]6、algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(7、inti=data.length/2;i>2;i/=2){for(intj=0;j=inc)&&(data8、[j]
4、-1]){SortUtil.swap(data,j,j-1);}}}}}选择排序:packageorg.rut.util.algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassSelectionSortimplementsSortUtil.Sort{/**(non-Javadoc)**@seeorg.rut.util.
5、algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){inttemp;for(inti=0;i>i;j--){if(data[j]6、algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(7、inti=data.length/2;i>2;i/=2){for(intj=0;j=inc)&&(data8、[j]
6、algorithm.support;importorg.rut.util.algorithm.SortUtil;/***@authortreeroot*@since2010-11-22*@version1.0*/publicclassShellSortimplementsSortUtil.Sort{/*(non-Javadoc)*@seeorg.rut.util.algorithm.SortUtil.Sort#sort(int[])*/publicvoidsort(int[]data){for(
7、inti=data.length/2;i>2;i/=2){for(intj=0;j=inc)&&(data
8、[j]
此文档下载收益归作者所有