public static void sort(Comparable[] a){
int N = a.length;
for(int i=1;i<N;i++){
Comparable temp = a[i];
int j;
for(j=i-1;j>=0 && less(temp, a[j]); j--){
a[j+1] = a[j];
}
a[j+1] = temp;
}
}
算法 第四版 2.1.25 不需要交换的插入排序
最新推荐文章于 2025-06-06 13:16:02 发布