What is Huffman Coding?

Fixed Length Code vs Prefix Code

Application

Encoding Algorithm

  1. Scan target file and calculate frequency of each characters

  2. Compose Min-Heap with frequency as priority

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5a9cfdeb-88fe-43f6-b6af-dbbcb8806203/Untitled.png

  3. Remove two nodes that have least frequency

  4. Insert empty node with two removed nodes as child node

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/de4f0815-e29a-448e-9821-774f40e4da51/Untitled.png

  5. Repeat 3 - 4 until a node is left

  6. Set left node as root node

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/201a387c-c264-4c89-8f6d-34c34106615e/Untitled.png

Decoding Alogorithm

Application to Deep Learning