。。。插入排序。。。

public void insertSort(int[] array) {
    int i,j,t;
    for (i = 0; i < array.length; i++) {
        t = array[i];
        for (j = i - 1; j >= 0 && array[j] > t; j--) {
            array[j+1] = array[j];
        }
        array[j+1] = t; 
    }
}

  

原文地址:https://www.cnblogs.com/yingmeng/p/10547174.html