![]() |
| ||
| huffman code hi!! i want to know about the huffman algoriyhm and its implementation. how the huffman code works and its use, a code in c/c++ language |
| ||
| Re: huffman code Huffman was a guy who realized that letters do not occur statisticly randomly; 'e' is used a lot more than 'j'. He figured you could build a balanced tree of letters (or anything else that occurs non-randomly, like words) and using that tree, represent letters in a minimal number of bits. The original Huffman went like this: 1) count the occurances of the letters in your text to be compressed 2) build a binary tree such that the shortest paths in the tree go to the most referred-to letters 3) encode the tree as bits, where a 0 means go LEFT on the tree and 1 means go RIGHT. Later variants allowed the tree to be built dynamically as you see the charactors, as in processing a stream of bytes. Huffman is used as the post-processing in many compressors, like gzip (which first removes blocks of common letters and then Huffmanizes the result) and jpeg (which converts pixels into cosine values and Huffmanizes the resulting (nearly the same) values). Google will get you to some sample code easily. Now that you know the basics, the code should be pretty readable. Good luck! |
| ||
| Re: huffman code thanks a lot !!!! but i have a problem with the code i have counted the frequency but i am not able to build the heap which i have to build to finally make a tree. help me here!!!! |
| ||
| Re: huffman code Google is your programming friend! Here's what I found with "Huffman algorithm": http://ciips.ee.uwa.edu.au/~morris/Y...0/huff-op.html Looks like just what you want! |
| ||
| Re: huffman code Quote:
* http://alexvn.freeservers.com/s1/huf...algorithm.html * http://sourceforge.net/projects/huffman-ta/ |
| ||
| Re: huffman code Quote:
|
| ||
| Re: huffman code >I would be highly grateful if u give me the code I'm sure you would. Do your own work, it's much more rewarding. |
| ||
| Re: huffman code Please give me an idea of how to do program the huffman code in C |
| ||
| Re: huffman code Quote:
http://www.daniweb.com/code/snippet5.html Test it, improve it, learn from it! |
| ||
| Re: huffman code Stop begging for code. Do your own work and read this thread http://www.daniweb.com/forums/announcement8-2.html |
| All times are GMT -4. The time now is 4:11 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC