전체 글 (281) 썸네일형 리스트형 선택 정렬 비교가 상대적으로 많다 버블 소트보다는 정렬 횟수가 적다 int[] a = {5,1,6,2,4,3}; int size = a.length; int min = 0; int temp = 0; for(int i = 0 ; size > i ;i++){ min=i; for(int j = i+1 ; size > j ; j++){ if(a[min] > a[j]){ min=j; } } temp = a[min]; a[min] = a[i]; a[i] = temp; } 이전 1 ··· 33 34 35 36 다음