Huffman algorithm realization