def insertionSort(array):
counter = 0
for i in range(len(array)):
min = array[i]
for comp in range(counter + 1, len(array)):
if array[comp] < min:
min = array[comp]
array[i], array[comp] = array[comp], array[i]
counter += 1
return array
'Algorithms and Data Structures > Coding Practices' 카테고리의 다른 글
LeetCode 3. Longest Substring Without Repeating Characters (0) | 2022.07.16 |
---|---|
LeetCode 200. Number of Islands (0) | 2022.07.16 |
AlgoExpert Bubble Sort (0) | 2022.07.16 |
AlgoExpert Find Three Largest Numbers (0) | 2022.07.15 |
AlgoExpert BinarySearch (0) | 2022.07.15 |