随笔分类 -  排序

摘要:1 public class Test { 2 public static void main(String[] args) { 3 int[] arr = {5, 2, 6, 8, 9, 1}; 4 if (arr == null || arr.length = 0 && arr[j] > arr[j + 1]; j--) { 10 ... 阅读全文
posted @ 2019-09-29 19:44 青稞123 阅读(159) 评论(0) 推荐(0)
摘要:1 public class Test { 2 public static void main(String[] args) { 3 int[] arr = {5, 2, 6, 8, 9, 1}; 4 if (arr == null || arr.length <= 2) { 5 return; 6 } 7 for (int i = 0; i < arr.length - 1; i++) { 8 阅读全文
posted @ 2019-09-29 19:36 青稞123 阅读(156) 评论(0) 推荐(0)
摘要:1 public class Test { 2 public static void main(String[] args) { 3 int[] arr = {5, 2, 6, 8, 9, 1}; 4 if (arr == null || arr.length <= 2) { 5 return; 6 } 7 for (int end = arr.length - 1; end > 0; end-- 阅读全文
posted @ 2019-09-29 19:13 青稞123 阅读(140) 评论(0) 推荐(0)