Help with Huffman encoding
807591Apr 27 2008 — edited Apr 28 2008I've run into a bit of a problem trying to encode a text file using Huffman encoding. I've read in all the characters, counted their frequencies, and built the encoding tree. The part I'm having problems with is getting the code for each character. I understand how you're supposed to get it, adding zero to the code if you go left and one if you go right until you hit a leaf, I just can't figure out how to implement it. I have the tree implemented using a Node structure with each Node having a point to its left and right child. Could anyone point me in the right direction?