Skip to content

A Java-based tool that uses the Huffman coding algorithm for lossless file compression and decompression. It builds a Huffman Tree from character frequencies to generate efficient binary codes, reducing file size effectively.

Notifications You must be signed in to change notification settings

ahmedSherif-eng/Huffman-Compression-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Huffman Compression Tool

Overview

This project implements a Huffman coding-based compression tool. The tool uses Huffman coding to efficiently compress and decompress files. The encoding process involves building a frequency map of characters, constructing a Huffman tree, and generating prefix codes for each character. The decoding process reconstructs the Huffman tree from metadata and decodes the binary data back into the original text.

Features

  • File Compression: Compresses text files using Huffman coding.
  • File Decompression: Decompresses files that were compressed using this tool.
  • Frequency Map: Builds a frequency map of characters in the input file.
  • Huffman Tree: Constructs a Huffman tree based on character frequencies.
  • Prefix Codes: Generates prefix codes for each character.

Requirements

  • Java 8 or higher
  • Maven

Usage

To use the Huffman Compression Tool, run the MainProgram class with the following arguments:

java MainProgram <filePath> <operation {-e|-d}>

About

A Java-based tool that uses the Huffman coding algorithm for lossless file compression and decompression. It builds a Huffman Tree from character frequencies to generate efficient binary codes, reducing file size effectively.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages