Source: https://perso.liris.cnrs.fr/vincent.nivoliers/lifap6/Supports/TP/tp_huffman.pdf