Giter Site home page Giter Site logo

arehmanali / file-compression-tool-using-huffman-coding-algorithm Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 14.9 MB

File Compression tool is an C# desktop application using Huffman Encoding Algorithm

C# 100.00%
compression huffman-tree compression-algorithm huffman-coding huffman huffman-compression-algorithm huffman-compressor file-compression

file-compression-tool-using-huffman-coding-algorithm's Introduction

Compression OR Decompression Tool

Introduction

To reduce the time needed for files to be transmitted over a network, Compression and Decompression techniques are very useful. Developers prefer to write code to compress files before sending them out to the network for a file upload process. Web applications get the most benefit out of it. The .NET Framework provides the System.IO.Compression namespace, which contains the compressing and decompressing libraries and streams. Developers can use these types to read and modify the contents of a compressed file.

Huffman Coding Algorithm

Huffman coding is a lossless data compression algorithm. In this algorithm, a variable-length code is assigned to input different characters. The code length is related to how frequently characters are used. Most frequent characters have the smallest codes and longer codes for least frequent characters. There are mainly two major parts in Huffman Coding

  1. Build a Huffman Tree from input characters.
  2. Traverse the Huffman Tree and assign codes to characters.

Huffman Coding prevents any ambiguity in the decoding process using the concept of prefix code ie. a code associated with a character should not be present in the prefix of any other code.

Example

For an example, consider some strings “YYYZXXYYX”, the frequency of character Y is larger than X (frequency Y=5, frequency X=3) and the character Z has the least frequency. So the length of the code for Y is smaller than X, and code for X will be smaller than Z.

Time Complexity

Complexity for assigning the code for each character according to their frequency is **O(n log n)

Greedy Explanation

Huffman coding looks at the occurrence of each character and stores it as a binary string in an optimal way. The idea is to assign variable-length codes to input input characters, length of the assigned codes are based on the frequencies of corresponding characters. We create a binary tree and operate on it in bottom-up manner so that the least two frequent characters are as far as possible from the root. In this way, the most frequent character gets the smallest code and the least frequent character gets the largest code.

file-compression-tool-using-huffman-coding-algorithm's People

Contributors

arehmanali avatar justnaumanbhatti avatar

Stargazers

 avatar

Watchers

 avatar  avatar

file-compression-tool-using-huffman-coding-algorithm's Issues

Issues

Errors:
.1. The decompression of Pdf file take more time as compare to text or docx file.
2. If the size of compression file is large, compression of docx file show some error.
3. The size of pdf file after decompression is smaller than original file.
4. Sln File is not working on My Visual Studio so i check their project on video call.
5. UI should be Individual and attractive for all files.
6. Just one form have all the about of project it should have multiple and different UI.

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.