随笔分类 -  java

摘要:归并排序算法2.0( Merge sort) 算法最好最坏平均空间稳定性 递归 nlog2n nlog2n nlog2n n 稳定 import java.util.Arrays;​public class Marge {//递归算法Recursion algorithm public static 阅读全文
posted @ 2021-12-15 23:13 Open_xing 阅读(38) 评论(0) 推荐(0)
摘要:希尔排序(shell) 算法最好最坏平均空间稳定性 插入 O(n) O(n*n) O(n*1.3) 1 不稳定 package www.suanfa.entity;​public class Insertion {public static void main(String[] args) { in 阅读全文
posted @ 2021-12-13 22:28 Open_xing 阅读(141) 评论(0) 推荐(0)
摘要:希尔排序(shell) 算法最好最坏平均空间稳定性 插入 O(n) O(n*n) O(n*1.3) 1 不稳定 package www.suanfa.entity;​public class Insertion {public static void main(String[] args) { in 阅读全文
posted @ 2021-12-12 22:10 Open_xing 阅读(107) 评论(0) 推荐(0)
摘要:插入排序(Insertion) 算法最好最坏平均空间稳定性 插入 O(n) O(n*n) O(n*n) 1 稳定 public class Insertion {public static void main(String[] args) { int[] arr={4,5,7,8,9,6,3,2,1 阅读全文
posted @ 2021-12-11 23:21 Open_xing 阅读(243) 评论(0) 推荐(0)
摘要:冒泡排序 算法最好最坏平均空间稳定性 冒泡 O(n) O(n*n) O(n*n) 1 稳定 System.out.println("排序1到10的正序输出?"); int[] arr={2,5,8,9,6,3,1,4,7}; for(int i=arr.length-1;i>0;i--){ for( 阅读全文
posted @ 2021-12-10 19:56 Open_xing 阅读(97) 评论(0) 推荐(0)
摘要:简单排序算法 创建主方法,编写代码! ​public class Yunsuan {public static void main(String[] args){ System.out.println("排序1到10的正序输出?"); int[] arr={2,5,8,9,6,3,1,4,7}; f 阅读全文
posted @ 2021-12-09 19:07 Open_xing 阅读(115) 评论(0) 推荐(0)