int c[] = new int[]{1,6,4,9,4,3,2,8};
for (int i =1;i<c.length;i++){
for (int y = i-1;y>=0&&c[y]>c[y+1];y--){
int temp = c[y+1];
c[y+1] = c[y];
c[y] = temp;
}
}
for(int i:c){
System.out.print(i);
}
插入排序(java实现)
最新推荐文章于 2024-08-28 14:35:43 发布