constante entier N <- ... { Methode de recherche de l'indice de la valeur } { maximale d'un tableau restreint } { a ses n premieres valeurs } entier fonction indiceMaximum(n,t) Données n : entier t : Tableau [N] de entier Locales max : entier iMax : entier i : entier max <- t[n] iMax <- n pour i de n-1 à 0 pas -1 faire si t[i] > max alors max <- t[i] iMax <- i fsi fait retourner iMax fin action { Methode de tri par selection } { d'un tableau d'entiers } action triSelection(t) Données / Résultats t : Tableau [N] de entier Locales i : entier aux : entier iMax : entier pour i de N-1 à 1 pas -1 faire iMax <- indiceMaximum(i,t) si iMax != i alors aux <- t[iMax] t[iMax] <- t[i] t[i] <- aux fsi fait fin action