Giter Club home page Giter Club logo

abhikar12 / file-compression Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 171 KB

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.

C++ 100.00%
cpp compression encoding-decoding file-compression huffman-algorithm huffman-coding huffman-compression-algorithm

file-compression's Introduction

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

file-compression's People

Contributors

abhikar12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tyagi0320

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.