You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Selection sort is a sorting algorithm that selects the smallest element from an unsorted list in each iteration and places that element at the beginning of the unsorted list.
Time Complexity - O(n^2)
'''
def selectionSort(list, length):
for step in range(length):
min_idx = step
for i in range(step + 1, length):
# to sort in descending order, change > to < in this line