You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
335 B
10 lines
335 B
def tri_selection(liste):
|
|
n = len(liste)
|
|
|
|
for i in range(n):
|
|
# On suppose que le minimum est au début
|
|
indice_min = i
|
|
# On cherche le plus petit élément dans le reste de la liste
|
|
for j in range(i + 1, n):
|
|
if liste[j] < liste[indice_min]:
|
|
indice_min = j
|