[ds] update huffman coding (from leaf to root)