摘要: package InsertSort; public class InsertSort { //将a[1]...a[n-1]按大小插入到前面的序列中 //时间复杂度O(N2)、空间复杂度O(1)、稳定 public static void insertsort(int[] a){ for(int i=1;i=0;j--){ ... 阅读全文
posted @ 2016-05-13 20:35 cmmmmmmmc 阅读(109) 评论(0) 推荐(0)
摘要: package QuickSort; public class QuickSort { //时间复杂度O(nlogn) 最坏O(n2) //空间复杂度O(logn) 最坏O(n) public static void main(String[] args){ int[] a = {55,99,44,22,44,55,99,44,22,44,888,4}... 阅读全文
posted @ 2016-05-13 20:34 cmmmmmmmc 阅读(159) 评论(0) 推荐(0)