Skip to content

Commit bfd52df

Browse files
authored
Merge pull request #231 from TheAlgorithms/revert-22-patch-1
Revert "Update bubble_sort.py"
2 parents 3c61849 + 1611f40 commit bfd52df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: sorts/bubble_sort.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def bubble_sort(collection):
3131
[-45, -5, -2]
3232
"""
3333
length = len(collection)
34-
for i in range(length-1, -1, -1):#range(length-1, -1, -1)
35-
for j in range(i):#range(1, i)
34+
for i in range(length):
35+
for j in range(length-1):
3636
if collection[j] > collection[j+1]:
3737
collection[j], collection[j+1] = collection[j+1], collection[j]
3838

0 commit comments

Comments
 (0)