Skip to content

CodesWithPushkar/File-Compressor-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Huffman Coding Compression and Decompression

Project Overview

This project implements Huffman coding, a widely used lossless data compression algorithm. It consists of two separate programs:

  • Compressor: Compresses a given input file into a smaller representation.
  • Decompressor: Recovers the original file from the compressed data.

The project is implemented in C and uses modular design principles, splitting functionality into reusable components such as min-heap utilities, Huffman tree construction, and file operations.

Folder Structure

  • include/: Header files (.h) declaring functions and data structures.
  • src/: Source files (.c) implementing the logic.
  • test_data/: Sample files for testing compression and decompression.

How to Build

Use the following commands in your terminal (inside the project root folder): gcc src/compressor.c src/minheap.c src/huffman_tree.c src/file_ops.c -Iinclude -o compressor gcc src/decompressor.c src/minheap.c src/huffman_tree.c src/file_ops.c -Iinclude -o decompressor

How to Use

Compress a file:

./compressor <input_file> <output_compressed_file>

Decompress a file:

./decompressor <input_compressed_file> <output_decompressed_file>

Features

  • Efficient Huffman coding using min-heap-based tree construction.
  • Modular codebase for ease of maintenance and enhancement.
  • Separate tools for compression and decompression.

Developed as a part of an educational project on data compression.

About

Our team make a file compressor using C which compress text file using huffman file compression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published