/**
* @Params :
* @Author :scy
* @Date :2019/6/20
* description:直接插入排序
*/
public static int[] directInsertSort(int[] array) {
int len = array.length;
int temp;
int j;
for (int i = 1; i < len; i++) {
temp = array[i];//标记当前需要插入的数
for (j = i; j > 0 && temp < array[j - 1]; j--) {//当前数小于前面数
array[j] = array[j - 1];//那么前面的数就后移
}
array[j] = temp;
}
return array;
}