Concept Flow - Huffman Encoding
Count frequency of each char
Create leaf nodes for each char
Build min-heap of nodes
While heap size > 1
Extract two smallest nodes
Create new internal node with these two as children
Insert new node back to heap
Heap has one node left -> root of Huffman Tree
Traverse tree to assign codes
Encode input using codes
Huffman Encoding builds a tree from character frequencies, combining lowest frequency nodes step-by-step, then assigns binary codes by traversing the tree.
