import java.util.*;
public class BubbleSort {
public int[] bubbleSort(int[] a, int l) {
// write code here
for(int i = l-2;i>=0;i--){
for(int j=0;j<=i;j++){
if(a[j]>a[j+1]){
int temp = a[j] ;
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
return a;
}
}冒泡排序练习题
最新推荐文章于 2024-06-20 18:22:05 发布
2823

被折叠的 条评论
为什么被折叠?



