Concept Flow - Huffman Encoding
Count frequencies of chars
Create leaf nodes for each char
Build min-heap of nodes
While heap size > 1
Pop two smallest nodes
Create new node with these two as children
Insert new node back into heap
Heap has one node -> root of Huffman tree
Traverse tree to assign codes
Encode input using codes
Huffman Encoding builds a tree from character frequencies to assign short codes to frequent chars, compressing data.
