Merge pull request #74 from danerlt/master

update bubble_sort
This commit is contained in:
Angelos Chalaris
2019-08-19 13:52:11 +03:00
committed by GitHub

View File

@ -78,9 +78,7 @@ def bubble_sort(lst):
for passnum in range(len(lst) - 1, 0, -1):
for i in range(passnum):
if lst[i] > lst[i + 1]:
temp = lst[i]
lst[i] = lst[i + 1]
lst[i + 1] = temp
lst[i], lst[i + 1] = lst[i + 1], lst[i]
```
<details><summary>View Examples</summary>