mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +00:00
Optimised for loop iteration
This commit is contained in:
parent
6a6349bdb0
commit
98cc298e61
|
@ -31,7 +31,7 @@ def selection_sort(collection):
|
|||
"""
|
||||
|
||||
length = len(collection)
|
||||
for i in range(length):
|
||||
for i in range(length - 1):
|
||||
least = i
|
||||
for k in range(i + 1, length):
|
||||
if collection[k] < collection[least]:
|
||||
|
|
Loading…
Reference in New Issue
Block a user