Huffman Coding
Huffman coding is one data compression algorithm that is commonly used for lossless data compression. The algorithm assigned binary codes to ASCII symbols based on frequency of the symbol’s appearance, which reduces the overall bits used to encode a message, and creates a Huffman tree which can be decompresed to recreate the original string.
-
Lecture (Part 0)
-
Lecture (Part 1)
-
Short
-
Supplementary Resources
- RosettaCode on Huffman Coding
- Khan Academy on Huffman Coding
-
Thought Questions
- Do you think this is an efficient algorithm?
- Huffman coding is lossless because the message that was compressed must be decompressed back to the original message. Is there a limit to lossless compression? Can you think of when we would use lossy data compression instead?
-
Problems