mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Revert "Update bubble_sort.py"
This commit is contained in:
parent
abd9d78a62
commit
a04d5c5e1e
|
@ -30,7 +30,7 @@ def bubble_sort(collection):
|
||||||
[-45, -5, -2]
|
[-45, -5, -2]
|
||||||
"""
|
"""
|
||||||
length = len(collection)
|
length = len(collection)
|
||||||
for i in range(length-1):
|
for i in range(length):
|
||||||
for j in range(length-1):
|
for j in range(length-1):
|
||||||
if collection[j] > collection[j+1]:
|
if collection[j] > collection[j+1]:
|
||||||
collection[j], collection[j+1] = collection[j+1], collection[j]
|
collection[j], collection[j+1] = collection[j+1], collection[j]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user