Shannon-Fano Coding
Shannon-Fano Coding is a method of data compression that assigns variable-length codes to different symbols based on their frequencies. The most frequent symbols receive shorter codes, while less frequent symbols get longer codes. This approach helps reduce the overall size of the data being transmitted or stored.
The process begins by sorting the symbols in descending order of frequency. Then, the symbols are divided into two groups with approximately equal total frequencies. This division continues recursively until each symbol has a unique binary code. Shannon-Fano Coding is a precursor to more advanced coding techniques like Huffman Coding.