Created
February 14, 2019 18:13
-
-
Save pysoftware/ea6e5f595cfef945548cb0e90a37d787 to your computer and use it in GitHub Desktop.
Selection sort/ Сортировка выбором
This file contains hidden or 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
# Selection sort alghorirm | |
# Алгоритм сортировки выбором | |
a = [3, 5, 1, 0, 2, 8] | |
for j in range(1,len(a)): | |
i = j-1 | |
while i >= 0 and a[i] > a[i+1]: | |
a[i], a[i+1] = a[i+1], a[i] | |
i -= 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment