Created
May 7, 2017 10:43
-
-
Save ivankahl/104107fe97183b1d661c5d0d7ae95d08 to your computer and use it in GitHub Desktop.
selectionSort.py
This file contains 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
def selection_sort(arr): | |
for i in range(len(arr) - 1): | |
for j in range(i + 1, len(arr)): | |
if arr[j] < arr[i]: | |
arr[j], arr[i] = arr[i], arr[j] | |
return arr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment