[정렬 방법]
정렬 알고리즘은 사용자가 지정한 기준에 맞게 정렬하여 출력하는 알고리즘이다. 대표적으로 버블소트, 힙소트, 머지소트, 퀵소트, 선택 소트,삽입소트,기수 정렬이 있다. 선택 정렬(selection Sort) 현재 값을 기준으로 뒤에 값들을 비교해서 뒷 값이 더 작으면 Swap하는 방식(오름차순 기준) . void selectionSort(int *list, const int n) { int i, j, indexMin, temp; for (i = 0; i < n - 1; i++) { indexMin = i; for (j = i + 1; j < n; j++) { if (list[j] < list[indexMin]) { indexMin = j; } } temp = list[indexMin]; list[index..
2021. 5. 10.