Skip to content

Commit ab8340c

Browse files
authored
Update bubble_sort.py
1 parent 4569955 commit ab8340c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sorts/bubble_sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def bubble_sort(collection):
3030
[-45, -5, -2]
3131
"""
3232
length = len(collection)
33-
for i in range(length):
33+
for i in range(length-1):
3434
for j in range(length-1):
3535
if collection[j] > collection[j+1]:
3636
collection[j], collection[j+1] = collection[j+1], collection[j]

0 commit comments

Comments
 (0)