Browse Source

Transférer les fichiers vers ''

master
RAVET Célya 1 month ago
parent
commit
e280dd77ed
  1. 9
      tri selection.py

9
tri selection.py

@ -8,3 +8,12 @@ def tri_selection(liste):
for j in range(i + 1, n):
if liste[j] < liste[indice_min]:
indice_min = j
# On échange les éléments
liste[i], liste[indice_min] = liste[indice_min], liste[i]
return liste
# Exemple d'utilisation
ma_liste = [64, 25, 12, 22, 11]
print(tri_selection(ma_liste))
Loading…
Cancel
Save