def selection_sort(arr):
    n = len(arr)
    for i in range(n):
        min = i
        for j in range(i,n):
            if arr[j] < arr[min]:
                min = j
        arr[i],arr[min] = arr[min] ,arr[i]
    return arr

arr = [64, 25, 12, 22, 11]
print(selection_sort(arr))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: