The Huffman algorithm is lossless compression algorithm where frequency of individual letters are used to compress the data. The idea behind the algorithm is that if you have some letters that are more frequent than others, it makes sense to use fewer bits to encode those letters than to encode the less frequent letters.
Example
HELLO WORLD
Letter Frequency
H 1
E 1
L 3
O 2
Space 1
W 1
R 1
D 1
In the above example we should use least number of bits for L, followed by O, followed by rest.
Check the following link which nicely describe the algorithm
http://www.cprogramming.com/tutorial/computersciencetheory/huffman.html