Simple realization of Huffman algorithm