Exercise: Selection Sort

Run Settings
LanguagePython
Language Version
Run Command
def selectionSort(array): currentMin = None n = len(array) for i in range(n-1): min_index = i for j in range(i+1, n): if array[j] < array[min_index]: min_index = j array[i], array[min_index] = array[min_index], array[i] return array numbers = [99, 44, 6, 2, 1, 5, 63, 87, 283, 4, 0] answer = selectionSort(numbers) print(answer)
Editor Settings
Theme
Key bindings
Full width
Lines