Skip to content

Maartz/huffman_encoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Huffman Encoding Project

This project is a deliberate practice exercise to become more familiar with memory-managed languages, specifically using the Zig programming language. The challenge tackled here is implementing a Huffman Encoder/Decoder, an idea inspired by the coding challenge found here.

Requirements

To compile and run this project, you must have Zig installed from the @master branch. You can install Zig by following the instructions from the official Zig website.

Compilation

To compile the project, simply run:

zig build

Usage

Once compiled, the program can be run with the following parameters:

  • --input <file.txt>: The input file that contains the data to be encoded.
  • --output <myencodeddata>: The output file where the encoded data will be written.
  • --tree <huffman_tree_file> (optional): An optional parameter to pass your own text to generate a Huffman tree used for encoding.

Example

./huffman --input file.txt --output encoded_output --tree my_tree.txt

If you omit the --tree parameter, the program will generate its own Huffman tree based on a specific file in the project 135-0.txt.

Learning Objective

The purpose of this project is to practice working with a memory-managed language and to implement a classic compression algorithm from scratch.

Acknowledgments

This project is based on the Huffman encoding challenge found at Coding Challenges.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages