Huffman coding

In this repository I'll try to implement the Huffman coding algorithm.
This is a lossless compression algorithm.
It author proved mathematically that it is the most efficient way to assign bits to single character.

The algorithm to encode a string is divided in 4 main steps.

  1. Making a table of every occurences of every character
  2. Sorting them from lowest highest occurences to lowest
  3. Creating a tree out of those occurences by summing the two small numbers until there is only one root left
  4. Writting the table made at step 3 and the string newly string encoded

Explanation

Explain complexity of every step

Setup

Conclusion