bubblesort
-
정렬 : Bubble Sort (버블정렬, 거품정렬)algorithm 2013. 5. 22. 10:47
참조 : http://en.wikipedia.org/wiki/Bubble_sort 시간 복잡도 가장 나쁜 경우 : O(n^2) 가장 좋은 경우 : O(n) 평균 성능 : O(n^2) 장점 구현이 단순함. 소스 public class BubbleSort { public static void main(String[] args) { int nData = 10;//정렬할 데이터 개수 설정. double TargetDataList[] = new double[nData]; //데이터 생성 for(int i = 0; i < nData; i++) { TargetDataList[i] = Math.random(); System.out.print(TargetDataList[i]+" ");//데이터 출력 } System.ou..