mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-27 17:06:44 +00:00
Update bubble_sort.py (#535)
This commit is contained in:
parent
f0d5bc6ece
commit
ce0a013ad7
@ -17,6 +17,9 @@ def bubble_sort(collection):
|
|||||||
|
|
||||||
>>> bubble_sort([-2, -5, -45])
|
>>> bubble_sort([-2, -5, -45])
|
||||||
[-45, -5, -2]
|
[-45, -5, -2]
|
||||||
|
|
||||||
|
>>> bubble_sort([-23,0,6,-4,34])
|
||||||
|
[-23,-4,0,6,34]
|
||||||
"""
|
"""
|
||||||
length = len(collection)
|
length = len(collection)
|
||||||
for i in range(length-1):
|
for i in range(length-1):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user