Skip to content

The project is to design compression and decompression programs using Huffman Coding. The idea is to assign variable length codes to input characters based on their frequencies. The more the frequency of the character the shorter the code assigned to it.

Notifications You must be signed in to change notification settings

Abhikar12/File-Compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File-Compression System Using Huffman Coding in C++

The project is to design compression and decompression programs using Huffman Coding. The idea is to assign variable length codes to input characters based on their frequencies. The more the frequency of the character the shorter the code assigned to it.

#Implementation:

The program has been implemented in C++ language. The idea is to reduce the weighted expected storage by means of assigning shorter codes to frequently occurring characters.

#Compression:

Provide the input. Note the frequency of all the characters in the input. Construct a min priority queue with respect to the frequencies of the characters. Construct Huffman Tree from the priority queue. Encode the file, store the encoding table and compress the input based on the encoding table.

The codes are stored as bits and each character is provided a prefix code which is a string of bits.

image

#Decompression:

Open the file and reconstruct the Huffman Tree based on the Encoded table. Decode the file and store it to the desired file.

image

#Finding Compression Rate:

A compression varying from 6-7% of the initial input file is achieved.

image

#Output:

  1. Codes - OutPut

  2. Output - OutPut1

About

The project is to design compression and decompression programs using Huffman Coding. The idea is to assign variable length codes to input characters based on their frequencies. The more the frequency of the character the shorter the code assigned to it.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages