摘要: 概念通过n-i次关键字间的比较,从n-i+1个记录中选出关键字最小的记录,并和第i个记录交换Java代码实现 public static void select(Integer[] array) { int min; for (int i = 0; i array[j]) min = j; } // end for compare length-i+1 elements // find the smallest element and swap with ith element if (i != min) Helper.swap(array, i, min); } // e... 阅读全文
posted @ 2013-12-23 23:33 sxplus 阅读(315) 评论(0) 推荐(0) 编辑