Huffman and LZW in cpp