Code Monkey home page Code Monkey logo

huffman's Introduction

#Author Nick Caamano

Description

This program provides the user an interface to create a Huffman Code
from a range of frequencies of characters from a sample.txt file of a
popular literary work. The huffman code is generated from a binary huffman
tree that is created when the sample.txt is read. This tree groups frequencies
of characters into nodes and subsequentially generates binary encodings when 
the tree is traversed. These encodings are stored in a file called libary.txt when
the user chooses this function. The user also has the option to print the frequecy 
table of each character in the file. Additionally the user can encode a unique input
string as long is it is composed of characters from library.txt. The user can also
provide an encoded message and the program will decode it using libary.txt. 

Instructions

To compile the program, use:

$ make

To run the program, use:

$ ./huffman

To use program, type first:

1

to read sample.txt and generate huffman tree and huffman code into library.txt

Then type either:

2

to print the frequency table

or

3

to encode a specific input string

or

4

to decode a specific binary input string.

NOTE:You must press 1 or 2 before encoding or decoding. Library.txt must exist to perform these functions. We will sumit this project without libary.txt so this is necessary. For option 3 you must ONLY use characters in sample.txt and library.txt For option 4 if you type a binary encoding that is not recognized by library.txt nothing will print for the decoded message. Be careful with extra spaces or characters when typing in the decoded message. Also note that libary.txt is reset after every time the program exits.

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.