摘要: 经典算法 “挖坑填数+分治” 看快排代码的时候在想为什么别人总是说先要从后往前比较呢? 今天研究代码逻辑终于明白了!!! 选择中枢的时候是 pivotKey=arr[0]; 我们先从后往前查找, while (i < j && arr[j] >= pivotKey) j--; if (i < j) 阅读全文
posted @ 2019-07-15 14:28 zhaozishuang 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1 public class BubbleSort{ 2 public static void main(String args[]){ 3 BubbleSort bubbleSort=new BubbleSort(); 4 5 int arr_test[]={5,6,2,1,9}; 6 bubbleSort.bubbleSo... 阅读全文
posted @ 2019-07-15 11:44 zhaozishuang 阅读(144) 评论(0) 推荐(0) 编辑