Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 29, 2020 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/727464802cddcf62f23e660a6e6695b3 to your computer and use it in GitHub Desktop.
Save amankharwal/727464802cddcf62f23e660a6e6695b3 to your computer and use it in GitHub Desktop.
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