摘要: 后续更新双端快排,以及Arrays.sort()中的三路快排。 public void quickSort(int[] num,int start,int end){ if (start>=end){ return; } int i = start; int j = end; while(i<j){ 阅读全文
posted @ 2020-07-02 18:58 大猪蹄子饲养员 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 从左开始遍历,找到比当前值小的后一个索引位置,然后插入 public void insertSort(int[] num){ for (int i = 1; i < num.length; i++) { int preIndex = i - 1; int currentVal = num[i]; w 阅读全文
posted @ 2020-07-02 18:56 大猪蹄子饲养员 阅读(152) 评论(0) 推荐(0) 编辑