Skip to content

Instantly share code, notes, and snippets.

@ivankahl
Created May 7, 2017 10:43
Show Gist options
  • Save ivankahl/104107fe97183b1d661c5d0d7ae95d08 to your computer and use it in GitHub Desktop.
Save ivankahl/104107fe97183b1d661c5d0d7ae95d08 to your computer and use it in GitHub Desktop.
selectionSort.py
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