That's a picture of me in Baldwin Hills, Santa Monica
Bangalore based engineer currently helping SMEs grow via SMERGERS. Interested in Programming, Design, Startups and a few other things. MS-CS @USC, Los Angeles, BE @BMSCE.
I can be reached on
krishna [at] krishnabharadwaj [dot] info
Here are some of my other online profiles
Powered by Python and Django
kb
Geek, Programmer, FOSS Enthusiast, MS CS @USC. Loves Python / Django. Co-founder @ SMERGERS, Previously at Google, BlockBeacon, NI R&D

Huffman Encoding 18-Jan-2009


Huffman coding is a variable length encoding technique. More about it can be found here.
This program accepts the characters and their probability as the input. and generates the Huffman codes for each of the characters. I have used a Linked list which slowly transforms into a tree thereby creating the Huffman Tree. The codes are obtained by the inorder traversal.

For testing i prefer redirecting a file as input. So i'm attaching the input file as well.. One can do the same..

$ g++ huffman.cpp

$ ./a.out < huffman.input

Here's the input file


blog comments powered by Disqus