This Python script implements Huffman coding, a method for lossless data compression. Huffman coding assigns variable-length codes to input characters, with shorter codes assigned to more frequent characters.
- Huffman tree construction for efficient encoding and decoding.
- Calculation of average code length, entropy, and efficiency.
- Interactive input to analyze Huffman coding for any given text.
- Python 3.x
- NumPy (for calculating entropy)
- Clone the repository:
git clone https://github.com/k3shii/huffman_encoder.git- Installation:
pip install -r requirements. txt- Navigate to the project directory:
cd huffman_encoder- Run the script:
python huffman.py
