var entier n = longueur(t) si n <= 1 alors retourne t sinon pivot = t[ n / 2] var vecteur entier tinf, tegal, tsup # ici le premier indice du tableau est 1 pour i dans [1 : n] faire si t[i] < pivot alors ajoute_en_fin(tinf, t[i]) sinon si t[i] > pivot alors ajoute_en_fin(tsup, t[i]) sinon ajoute_en_fin(tegal, t[i]) retourne tri(tinf) + tegal + tri(tsup)