mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 06:48:09 +00:00
Update bogo_sort.py (#8144)
This commit is contained in:
parent
126e89d8a3
commit
1bf03889c5
|
@ -31,8 +31,6 @@ def bogo_sort(collection):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def is_sorted(collection):
|
def is_sorted(collection):
|
||||||
if len(collection) < 2:
|
|
||||||
return True
|
|
||||||
for i in range(len(collection) - 1):
|
for i in range(len(collection) - 1):
|
||||||
if collection[i] > collection[i + 1]:
|
if collection[i] > collection[i + 1]:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user