Coder Social home page Coder Social logo

viniciusmarchi / huffman-algorithm Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 21 KB

Implementation of Compression Huffman Algorithm in C++

License: MIT License

C++ 100.00%
huffman huffman-coding huffman-compression-algorithm huffman-encoder huffman-tree algoritmo-huffman huffman-compressao cpp huffman-tables minheap minheap-structure

huffman-algorithm's Introduction

Portuguese Version ๐Ÿ‡ง๐Ÿ‡ท

Table of Contents

Introduction - Huffman Algorithm

Implementation of Compression Huffman Algorithm in C++

Huffman's algorithm uses a file compression method based on the probability of occurrence of characters in text.

Features

In this implementation the Huffman Algorithm is defined by the concept of digital search, described by Digital Search Tree, which will allow the compression and decompression of text files (.txt).

This code will receive a input file, a .txt file which will be compressed, and generates two files as output:

  • encoded.txt: represents the compressed file, in binary. This file is the result of running Huffman's algorithm on the input file.
  • decoded.txt: represents the decoded file. This file is the result of applying Huffman's algorithm on the encoded.txt file. In other words, it's decompression. This file works as a validation, because if the algorithm performed the compression/decompression process correctly, this file must be exactly equal to the file used as input for compression.

How to use

To run code just compile the files contained in src folder. To do this, perform the following simple steps

Compiling files

  • Clone repository

    git clone [email protected]:ViniciusMarchi/huffman-algorithm.git
  • Go to project folder

    cd huffman-algorithm
  • Compile the file contained in src directory using g++ with the following command:

    g++ -o compilled src/*.cpp

Run algorithm

After compiling, just run the compiled file, passing as a parameter the .txt input file to be compressed, for example.

./compilled input.txt

huffman-algorithm's People

Contributors

viniciusmarchi avatar

Watchers

 avatar

Forkers

margadz27

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.