Jesseylove

导航

2017年11月4日 #

希尔排序

摘要: package algorithm; import java.util.Arrays; public class ShellSort { public static void shellSort(int[] arr,int[] d) { /** * 希尔排序:用一个增量序列作为每一次直接插入排序的间隔,直到间隔为1 */ ... 阅读全文

posted @ 2017-11-04 17:18 Jesseylove 阅读(180) 评论(0) 推荐(0) 编辑

加监视哨的直接插入排序

摘要: package algorithm; public class StraightInsertSort { /** * 加监视哨的直接插入排序 * @param arr */ public static void insertSort(int[] arr) { int i,j; for(i=2;iarr[0];j--) { arr[j+1]=arr[j]... 阅读全文

posted @ 2017-11-04 15:16 Jesseylove 阅读(760) 评论(0) 推荐(0) 编辑

堆排序(大根堆)

摘要: package algorithm; public class LargeHeapSort { /** * 对数组进行调整,使得arr[low]成为low-len最大的 * @param arr * @param low 当前二叉树(堆的一部分)的根 * @param len 数组的长度 */ public static vo... 阅读全文

posted @ 2017-11-04 10:10 Jesseylove 阅读(1837) 评论(0) 推荐(0) 编辑