public static void main(String[] args) {
int[] array = {12, 123,123, 6,23,53,52,23,5,12,7452,123};
int temp;
for(int i = 0; i < array.length; i++){
for(int j = i + 1; j < array.length; j++){
if(array[i] > array[j]){
temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
for(int i = 0; i < array.length; i++)
System.out.print(array[i] + " ");
}
왜 거품정렬 문서에 소스로 실려있노
http://ko.wikipedia.org/w/index.php?title=%EA%B1%B0%ED%92%88_%EC%A0%95%EB%A0%AC&diff=8384857&oldid=7699566
버블
그래요?