일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- HTML
- 포인터
- 플러터
- 다트 언어
- docker
- c# 윈폼
- vim
- jupyter lab
- Flutter
- 유니티
- git
- gitlab
- jupyter
- Houdini
- Data Structure
- 도커
- c언어
- 깃
- github
- Unity
- Python
- C++
- c# winform
- c# 추상 클래스
- C언어 포인터
- C# delegate
- dart 언어
- 구조체
- c#
- Algorithm
Archives
- Today
- Total
목록선택 정렬(Selection Sort): 성능평가 (1)
nomad-programmer
[Programming/Algorithm] 선택 정렬(Selection Sort)
선택 정렬은 버블 정렬보다도 쉽고 간단한 알고리즘이다. 선택 정렬은 정렬순서에 맞게 하나씩 선택해서 옮기는, 옮기면서 정렬이 되게 하는 알고리즘이다. 정렬순서상 가장 앞서는 것을 선택해서 가장 왼쪽으로 이동시키고, 원래 그 자리에 있던 데이터는 빈 자리에 가져다 놓는다. #include using std::cout; using std::cin; using std::endl; void SelSort(int arr[], int n) { int maxIdx; int temp; for (int i = 0; i < n - 1; i++) { maxIdx = i; // 최솟값 탐색 for (int j = i + 1; j < n; j++) { if (arr[j] < arr[maxIdx]) { maxIdx = j; } ..
Programming/Algorithm
2021. 3. 8. 01:02