https://github.com/abdallahhemdan/huffman-coding-compression
📦 Huffman Coding Compression Algorithms with Encoding and Decoding using C++
https://github.com/abdallahhemdan/huffman-coding-compression
binary-tree compression-algorithm cpp data-structures huffman-coding huffman-compression-algorithm
Last synced: about 1 month ago
JSON representation
📦 Huffman Coding Compression Algorithms with Encoding and Decoding using C++
- Host: GitHub
- URL: https://github.com/abdallahhemdan/huffman-coding-compression
- Owner: AbdallahHemdan
- License: mit
- Created: 2019-04-15T19:52:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-15T20:16:49.000Z (about 6 years ago)
- Last Synced: 2025-03-31T23:39:07.940Z (3 months ago)
- Topics: binary-tree, compression-algorithm, cpp, data-structures, huffman-coding, huffman-compression-algorithm
- Language: C++
- Homepage:
- Size: 4.76 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 📦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 othersSo 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
```