摘要: public class BubbleSort { public static void main(String[] args){ int[] arr = new int[]{5,1,3,6,8,2,10,19,15}; // 普通版 // bubbleSort(arr); // 进阶版 bubbl 阅读全文
posted @ 2022-03-23 08:51 fjhnb 阅读(40) 评论(0) 推荐(0)
摘要: (left+right)/2 可能会导致越界,可以写成left + (right - left)/2, 或者无符号右移 >>>1 public class BinarySearch { public static void main(String[] args){ int[] arr = new i 阅读全文
posted @ 2022-03-23 08:27 fjhnb 阅读(30) 评论(0) 推荐(0)