插入排序
/** * 插入排序 * @param numbers */ static void insertSort(int[] numbers){ for (int i = 0; i < numbers.length; i++) { for (int j = i; j > 0; j--) { if (numbers[j] < numbers[j-1]) { int tmp = numbers[j]; numbers[j] = numbers[j-1]; numbers[j-1] = tmp; }else { break; } } } }