일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 다트 언어
- Flutter
- C# delegate
- 포인터
- dart 언어
- c# 윈폼
- Algorithm
- c언어
- gitlab
- Data Structure
- github
- jupyter lab
- vim
- 플러터
- Houdini
- 깃
- jupyter
- C언어 포인터
- c#
- C++
- Python
- HTML
- 도커
- docker
- c# 추상 클래스
- 유니티
- Unity
- git
- 구조체
- c# winform
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