선택정렬
비교데이터 인덱스 비교 시작 데이터 인덱스 비교끝 데이터 인덱스
5 4 3 1 0 1 3
1 4 3 5 기준점 0번 최소값은1 첫번째 자리로 이동 1 2 3
1 3 4 5 기준점 1번 2 3 3
for stand in range(데이터길이 -1):
lowest =stand
for index in range(stand + 1, 데이터 길이):
if data[lowest] > data[index]:
lowest = index
swap(lowest, stand)
'코딩테스트 준비 > 알고리즘' 카테고리의 다른 글
[알고리즘]병합정렬 with Python (0) | 2022.05.06 |
---|---|
[알고리즘]퀵소트 with Python (0) | 2022.05.06 |
[알고리즘]재귀함수 with Python (0) | 2022.05.05 |
[알고리즘]삽입정렬 with Python (0) | 2022.05.04 |
[알고리즘]버블 소트 with python (0) | 2022.05.03 |