Source: https://www.i3s.unice.fr/~map/Cours/DUT_API_TD_TP/C1-2_APIStructuresAlgorithmiquesdeBase.pdf