Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.02 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.02 KB

Huffman_Coding

This repository contains Python and MATLAB implementations of Huffman coding, a data compression algorithm.

Repository Structure

  • Python: Python code for Huffman coding.
  • Matlab: MATLAB code for Huffman coding.

Usage

Python (Huffman in Python)

  1. Go to the Python folder.
  2. Open Huffman.py.
  3. Modify symbols and values to match your data.
  4. Run Huffman.py to generate Huffman codes.

MATLAB (Huffman in MATLAB)

  1. Go to the Matlab folder.
  2. Run MainHuffman.m in MATLAB.
  3. Modify symbols and values to match your data.
  4. Run MainHuffman.m to generate Huffman codes.

Functionality

  • The code generates Huffman codes for a given set of symbols and their probabilities.
  • It calculates and displays Huffman codes for the given set of symbols using the generated Huffman codes.

Files

  • Python: Huffman.py
  • Matlab: Node.m, buildHuffmanTree.m, printNodes.m, MainHuffman.m

Example Data

Example data is provided in the scripts. Replace it with your data.