摘要: public class MergeSort { public static void main(String[] args) { int[] array = {3,2,4,1,5}; Sort(array, 0, array.length - 1); for (int i : array) { S 阅读全文
posted @ 2021-10-13 21:12 code-G 阅读(29) 评论(0) 推荐(0) 编辑
摘要: /** * 求一个数组的最大值 */ public class Recursive { public static void main(String[] args) { int[] array = {3,2,4,1,5}; System.out.println(RecursiveMax(array, 阅读全文
posted @ 2021-10-13 18:32 code-G 阅读(62) 评论(0) 推荐(0) 编辑
摘要: /** * 插入排序 */ public class InsertionSort { public static void main(String[] args) { int[] array = {3,1,4,5,2}; for (int i : Insertion(array)) { System 阅读全文
posted @ 2021-10-13 12:43 code-G 阅读(27) 评论(0) 推荐(0) 编辑
摘要: public class BubbleSort { public static void main(String[] args) { int[] array = {3,1,4,5,2}; for (int i : Bubble(array)) { System.out.println(i); } } 阅读全文
posted @ 2021-10-13 12:31 code-G 阅读(22) 评论(0) 推荐(0) 编辑
摘要: public class SelectionSort { public static void main(String[] args) { int[] array = {1,3,4,8,7,4,6,9,0}; for (int i : Selection(array)) { System.out.p 阅读全文
posted @ 2021-10-13 12:10 code-G 阅读(30) 评论(0) 推荐(0) 编辑