Original Post
Hey guys, need a little professional help. I''ve already made a pretty good huffman compression program, and it works ok, but I''ve recently figured out a new way of coding it so that it works 6x faster and more efficiently. So I went ahead and began to code it, however I''ve stumbled a little, and need some help (obviously).
My dilemma is as follows: in order to put my new enhancement plan together right, I need to be able to add nodes from the root down. I did have the algorithm working perfectly, but unfortunately later realized that it wasn''t producing optimal huffman codes for the data contained.
I need to be able to add nodes using a recursive algorithm, and I only have access to the data needing to be added, and its frequency. I''ve head from places about assigning some sort of key values to the data, and then adding them to the tree, but haven''t exactly found good resources stating exactly how this key allocation works.
Any thoughts?