Text Compression

In this lesson, you will understand the details of Huffman Encoding with the help of an exercise on text compression.

We'll cover the following...

The Huffman Encoding algorithm can be used to find provably optimal length prefix free codes to compress data that involves redundancies. For simplicity, the algorithm can be divided into five parts:

  1. First, we create a dictionaryA Python dictionary stores unordered key-value pairs. that records the frequency of each character in the input text in line 20 inside the function createFrequencyDictionary. This dictionary is called frequencyDictionary. We check for every unique character and add its count in the frequencyDictionary against the ...