2015年7月28日

摘要: 1 public static void main(String[] args){ 2 int a[] = {34, 8, 64, 51, 32, 21}; 3 selectSort(a); 4 for (int i = 0; i a[j]) {1... 阅读全文
posted @ 2015-07-28 15:18 pokemonzj 阅读(136) 评论(0) 推荐(0)
摘要: 1 public static void main(String[] args){ 2 int a[] = {34, 8, 64, 51, 32, 21}; 3 bubbleSort(a); 4 for (int i = 0; i a[j+1]) ... 阅读全文
posted @ 2015-07-28 15:06 pokemonzj 阅读(137) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2015-07-28 14:42 pokemonzj 阅读(94) 评论(0) 推荐(0)
摘要: 基本思想:算法先将要排序的一组数按某个增量d(n/2,n为要排序数的个数)分成若干组,每组中记录的下标相差d.对每组中全部元素进行直接插入排序,然后再用一个较小的增量(d/2)对它进行分组,在每组中再进行直接插入排序。当增量减到1时,进行直接插入排序后,排序完成。 1 public static v... 阅读全文
posted @ 2015-07-28 14:38 pokemonzj 阅读(164) 评论(0) 推荐(0)
摘要: 插入排序有N-1趟排序组成,对于p=1到N-1趟,插入排序必须保证位置0到p上的元素为已排序状态。 1 public static void main(String[] args){ 2 int a[] = {34, 8, 64, 51, 32, 21}; 3 ins... 阅读全文
posted @ 2015-07-28 14:08 pokemonzj 阅读(147) 评论(0) 推荐(0)

导航