Huffman coding compresses data by assigning shorter codes to frequent characters.
Example: in "aaabbc", 'a' appears times, 'b' twice, 'c' once.
Instead of fixed -bit codes, use variable: a= , b= , c= . Original: chars * bits = bits. Huffman: + + * = bits. % smaller! Constraint: the character set can have up to distinct characters, so the heap must handle large inputs efficiently. The compression ratio depends on frequency distribution. Uniform frequencies yield minimal compression.