Created
May 7, 2022 06:37
-
-
Save rossbu/0e8f69f555f078c13dd00e84b75c16bc to your computer and use it in GitHub Desktop.
na
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
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