Debugging the huffman tree building process in C++