알고리즘 25

[Elementary Sorting Algotithms] Selection sort

Smiliar to bubble sort, but instead of first placing large values into sorted position, it places small values into sorted position. 처음것과 그 다음 배열을 차례대로 비교해서 최소의 수를 '맨 마지막에' 앞으로 옮김, 그 후 반복 [5, 3, 4, 1, 2] [5, 3, 4, 1, 2] [5, 3, 4, 1, 2] [5, 3, 4, 1, 2] [1, 3, 4, 5, 2] Pseudocode store the first element as the smallest value you've seen so far compare this item to the next item in the array until ..

알고리즘 2022.12.18