def insere(t, i, v):
    """insère v dans t[0..i[ supposé trié"""
    j = i
    while j > 0 and t[j - 1] > v:
        t[j] = t[j - 1]
        j = j - 1
    t[j] = v

def tri_par_insertion(t):
    """trie le tableau t dans l'ordre croissant"""
    for i in range(1, len(t)):
        insere(t, i, t[i])