Vers le tri par sélection⚓︎
Code à trous
🐍 Script Python
def tri_selection(lst) :
...
Code à trous
🐍 Script Python
def tri_selection(lst) :
for ... in ... :
... = ...
for ... in ... :
if ... :
...
...
Code à trous
🐍 Script Python
def tri_selection(lst) :
for i in range(...):
... = i
for k in range(..., ...) :
if ... < ... :
... = ...
..., ... = ..., ...
Code à trous
🐍 Script Python
def tri_selection(lst) :
for i in range(len(lst)-1):
indice_min = ...
for k in range(..., len(lst)) :
if lst[...] < lst[...]:
indice_min = ...
lst[...], lst[...] = lst[...], lst[...]