Source: http://cours-fad-public.ensg.eu/pluginfile.php/2143/mod_resource/content/3/algorithmique_oct_2018.pdf