Huffman tree compress algorithm