排序
wxzyzydd
这个作者很懒,什么都没留下…
展开
-
希尔排序
package sort1; public class ShellSort { /** * 希尔排序的一趟插入 * @param arr 待排数组 * @param d 增量 */ public static void shellInsert(int[] arr, int d) { for(int i=d; i<arr.l原创 2016-11-29 22:22:12 · 158 阅读 · 0 评论 -
快排
// 冒泡+二分+递归分治 public class QuickSort { public static int partition(int[] arr, int left, int right) { int pivotKey = arr[left]; while (left < right) { while (left = pivotKey) right--;原创 2016-11-29 22:20:10 · 142 阅读 · 0 评论