Source: http://polaris.imag.fr/jean-marc.vincent/index.html/ALGO5/ALGO5-Analyse-cout.pdf