摘要:
public class Test { public static void main(String[] args) { int arr1[]={1,3,5,7,9}; int arr2[]={2,4,6,8,10}; memeryArray(arr1, arr2); } public static void ... 阅读全文
posted @ 2016-01-09 21:31
小纸条
阅读(250)
评论(0)
推荐(0)
摘要:
1 冒泡排序(不想多说) public class BubbleSort { public static void main(String[] args) { // TODO Auto-generated method stub int arr[]={1,6,0,-1,-100,90}; int temp=0; for... 阅读全文
posted @ 2016-01-09 19:49
小纸条
阅读(292)
评论(0)
推荐(0)
摘要:
快速排序时间复杂度是O(nLog2n),待排序列越接近无须,本算法效率越高。最坏是O(n^2),待排序列越接近有序效率越低。平均是O(nLog2n),与初始序列有关。 空间复杂度是O(nLog2n),因为需要栈的支持。 假设我们现在对“6 1 2 7 9 3 4 5 10 8”这个10个数进行排序。首先在这个序列中随便找一个数作为基准数(不要被这个名词吓到了,就是一个用来参照的... 阅读全文
posted @ 2016-01-09 19:48
小纸条
阅读(432)
评论(0)
推荐(0)