mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
optimization (#1303)
This commit is contained in:
parent
f0568d642e
commit
e80d248e65
@ -35,6 +35,7 @@ def selection_sort(collection):
|
||||
for k in range(i + 1, length):
|
||||
if collection[k] < collection[least]:
|
||||
least = k
|
||||
if least != i:
|
||||
collection[least], collection[i] = (collection[i], collection[least])
|
||||
return collection
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user