Salut, tu as cet algorithme ici
Un exemple ici