public class InsertSort {
public static void sort(long[] arr ){
long tmp =0 ;
int j ;
for (int i = 1; i < arr.length; i++) {
tmp = arr[i];
j = i - 1 ;
while(j >= 0 && arr[j] > tmp ){
arr[j+1] = arr[j];
j--;
}
arr[j+1] = tmp;
}
System.out.println();
}
}
02-22
5588
07-19
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交