-
-
Save amankharwal/727464802cddcf62f23e660a6e6695b3 to your computer and use it in GitHub Desktop.
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
a = [34, 56, 32, 89, 65, 54] | |
for i in range(len(a)): | |
index = i | |
for j in range(i+1, len(a)): | |
if a[index] > a[j]: | |
index = j | |
a[i], a[index] = a[index], a[i] | |
print("Sorted Array using Selection sort algorithm : ") | |
for i in range(len(a)): | |
print(a[i]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment