Skip to content

Instantly share code, notes, and snippets.

@Unitoi01
Created May 12, 2018 22:00
Show Gist options
  • Save Unitoi01/b2940b33c8cd8d72cfdb0162e84aae99 to your computer and use it in GitHub Desktop.
Save Unitoi01/b2940b33c8cd8d72cfdb0162e84aae99 to your computer and use it in GitHub Desktop.
SelectionSort
def selectionSort(arr):
for i in range(len(arr)):
minId= i
for j in range(i+1, len(arr)):
if(arr[minId][0]>arr[j][0]):
minId=j
arr[i], arr[minId]= arr[minId], arr[i]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment