mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Typos in comments in hill_climbing.py (#1667)
* Typos in comments in hill_climbing.py * fixup! Format Python code with psf/black push
This commit is contained in:
committed by
John Law
parent
36d229f82a
commit
1f2b1a88ab
@@ -24,17 +24,18 @@ def bubble_sort(list1):
|
||||
|
||||
"""
|
||||
|
||||
for i, num in enumerate(list1):
|
||||
try:
|
||||
if list1[i+1] < num:
|
||||
list1[i] = list1[i+1]
|
||||
list1[i+1] = num
|
||||
bubble_sort(list1)
|
||||
except IndexError:
|
||||
for i, num in enumerate(list1):
|
||||
try:
|
||||
if list1[i + 1] < num:
|
||||
list1[i] = list1[i + 1]
|
||||
list1[i + 1] = num
|
||||
bubble_sort(list1)
|
||||
except IndexError:
|
||||
pass
|
||||
return list1
|
||||
return list1
|
||||
|
||||
if __name__ == "__main__":
|
||||
list1 = [33,99,22,11,66]
|
||||
bubble_sort(list1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
list1 = [33, 99, 22, 11, 66]
|
||||
bubble_sort(list1)
|
||||
print(list1)
|
||||
|
||||
Reference in New Issue
Block a user