# tri par sélection
def echange(t, i, j):
tmp = t[i]
t[i] = t[j]
t[j] = tmp
def tri_par_selection(t):
"""trie le tableau t dans l'ordre croissant"""
for i in range(len(t)):
# t[0..i[ est trié et <= à t[i..[
# on cherche le minimum de t[i..[
m = i
for j in range(i + 1, len(t)):
if t[j] < t[m]:
m = j
echange(t, i, m)