【算法】程序猿不写代码是不对的18
2017-02-16 17:46
295 查看
package com.kingdz.algorithm.time201702; import java.util.Arrays; /** * 简单选择排序 * * @author kingdz * */ public class Algo16 { public static void main(String[] args) { int count = 10; int[] number = new int[count]; number = Algo13.fillArray(count, false); System.out.println(Arrays.toString(number)); selectSort(number); } private static void selectSort(int[] number) { for (int i = 0; i < number.length; i++) { int target = i; for (int j = i + 1; j < number.length; j++) { if (number[j] < number[target]) { target = j; } } Algo13.swap(number, i, target); System.out.println(Arrays.toString(number)); } } }
相关文章推荐
- 【算法】程序猿不写代码是不对的2
- 【算法】程序猿不写代码是不对的5
- 【算法】程序猿不写代码是不对的26
- 【算法】程序猿不写代码是不对的32
- 【算法】程序猿不写代码是不对的31
- 【算法】程序猿不写代码是不对的36
- 【算法】程序猿不写代码是不对的22
- 【算法】程序猿不写代码是不对的21
- 【算法】程序猿不写代码是不对的34
- 【算法】程序猿不写代码是不对的6
- 【算法】程序猿不写代码是不对的12
- 【算法】程序猿不写代码是不对的11
- 【算法】程序猿不写代码是不对的24
- 【算法】程序猿不写代码是不对的17
- 【算法】程序猿不写代码是不对的3
- 【算法】程序猿不写代码是不对的10
- 【算法】程序猿不写代码是不对的14
- 【算法】程序猿不写代码是不对的29
- 【算法】程序猿不写代码是不对的35
- 【算法】程序猿不写代码是不对的20