GithubHelp home page GithubHelp logo

abdallahhemdan / huffman-coding-compression Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 4.87 MB

📦 Huffman Coding Compression Algorithms with Encoding and Decoding using C++

License: MIT License

C++ 100.00%
huffman-coding huffman-compression-algorithm binary-tree compression-algorithm cpp data-structures

huffman-coding-compression's Introduction

📦Huffman Coding Compression

Huffman encoding is a way to assign binary codes to symbols that reduces the overall number of bits used to encode a typical string of those symbols.

As we all knowe each char stored in 8-bit of 0's and 1's which called fixed-length-encoding as we use the same number of bits to any char .

The idea of Huffman-Coding-Algorithm is to use variable-length-encoding + using the fact that some chars occurs more freq than others

So we assign variable-number of bits to each char based on its freq in the text.

Our main problem is in decoding the text Our solution is to use what called (Prefix Rule) which will result into (uniquely-decodable-codes) ==> "No Code is Prefix to another Code".

Example : we have Str = "aabacdab" 
	a	->        0 
	b	->	  10
	c	->	  110
	d	->	  111
then Str = 00100110111010

625px-Huffman_tree_2 svg

huffman-coding-compression's People

Contributors

abdallahhemdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

abdualmenan

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.