MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / isSorted

Function isSorted

sorts/bogosort.py:29–35  ·  view source on GitHub ↗
(collection)

Source from the content-addressed store, hash-verified

27 """
28
29 def isSorted(collection):
30 if len(collection) < 2:
31 return True
32 for i in range(len(collection) - 1):
33 if collection[i] > collection[i + 1]:
34 return False
35 return True
36
37 while not isSorted(collection):
38 random.shuffle(collection)

Callers 1

bogosortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected