Scan target file and calculate frequency of each characters
Compose Min-Heap with frequency as priority

Remove two nodes that have least frequency
Insert empty node with two removed nodes as child node

Repeat 3 - 4 until a node is left
Set left node as root node
