Last active
February 2, 2023 01:23
-
-
Save Anthonymcqueen21/ef5ea7d486873d0512f82f12e14298bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Selection Sorting | |
def selection_sort(arr): | |
for k in range(len(arr): | |
min_index = k # this is smallest element | |
for j in range(k+1, len(arr)): | |
if arr[min_index] > arr[j]: | |
min_index = j | |
arr[k], arr[min_index] = arr[min_index], arr[k] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tester