Skip to content

Instantly share code, notes, and snippets.

@rossbu
Created May 7, 2022 06:37
Show Gist options
  • Save rossbu/0e8f69f555f078c13dd00e84b75c16bc to your computer and use it in GitHub Desktop.
Save rossbu/0e8f69f555f078c13dd00e84b75c16bc to your computer and use it in GitHub Desktop.
na
import numpy as np
def selection_sort(x):
for i in range(len(x)):
swap = i + np.argmin(x[i:])
(x[i], x[swap]) = (x[swap], x[i])
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment