Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.332.268 Times

Algorithm::Huffman 0.09

  Date Added: July 09, 2010  |  Visits: 910

Algorithm::Huffman

Report Broken Link
Printer Friendly Version


Product Homepage
Download (110 downloads)



Algorithm::Huffman is a Perl extension that implements the Huffman algorithm. SYNOPSIS use Algorithm::Huffman; my %char_counting = map {$_ => int rand(100)} (a .. z, A .. Z); # or better the real counting for your characters # as the huffman algorithm doesnt work good with random data :-)) my $huff = Algorithm::Huffman->new(%char_counting); my $encode_hash = $huff->encode_hash; my $decode_hash = $huff->decode_hash; my $encode_of_hello = $huff->encode_bitstring("Hello"); print "Look at the encoding bitstring of Hello: $encode_of_hellon"; print "The decoding of $encode_of_hello is ", $huff->decode_bitstring($encode_of_hello), ""; This modules implements the huffman algorithm. The aim is to create a good coding scheme for a given list of different characters (or even strings) and their occurence numbers. ALGORITHM Please have a look to a good data compression book for a detailed view. However, the algorithm is like every good algorithm very easy. Assume we have a heap (keys are the characters/strings; values are their occurencies). In each step of the algorithm, the two rarest characters are looked at. Both get a suffix (one "0", the other "1"). They are joined together and will occur from that time as one "element" in the heap with their summed occurencies. The joining creates a tree growing on while the heap is reducing. Lets take an example. Given are the characters and occurencies. a (15) b(7) c(6) d(6) e(5) In the first step e and d are the rarest characters, so we create this new heap and tree structure: a(15) de(11) b(7) c(6) de / "0"/ "1" d e Next Step: a(15) bc(13) de(11) de bc / / "0"/ "1" "0"/ "1" d e b c Next Step: a(15) bcde(24) bcde / "0"/ "1" / de bc / / "0"/ "1" "0"/ "1" d e b c Next Step unifies the rest: Huffman-Table / "0"/ "1" / / bcde a / "0"/ "1" / de bc / / "0"/ "1" "0"/ "1" d e b c Finally this encoding table would be created: a 1 b 010 c 011 d 000 e 001 Please note, that there is no rule defining what element in the tree is ordered to left or to right. So its also possible to get e.g. the coding scheme: a 0 b 100 c 101 d 110 e 111.

Requirements: No special requirements
Platforms: Linux
Keyword: Algorithm Algorithmhuffman Libraries Next Step Programming
Users rating: 0/10

License: Freeware Size: 8.19 KB
USER REVIEWS
More Reviews or Write Review


ALGORITHM::HUFFMAN RELATED
Home & Leisure  -  Next Step Prep 1.1
Next Step Prep is a small, easy to use tool specially designed to offer you an e-book that offer you information about percentiles gre. You will be on your way in no time. Once you read this information you will have a better idea of how easy it...
 
Development Tools  -  Step-by-Step Seminar Registration 1.0
As different d-deDUstepsd-deDt of the registration process are completed, the current step gets check off as done and the next step lights up. Includes some very basic form validation.
40.96 KB  
Action Games  -  Climbers of Fortune 1.5
The Plot:COF is the next step in TV-Entertainment after Big Br*ther. You take the roll as a "Defender" (special kind government official) who has to defend a wall against incoming "Climbers" (volunteers hoping for medical attention). Refer to the...
2.3 MB  
Telephone Utilities  -  Gammu+ 0.30.00
Gammu+ project can be named as next step in evolution. Author of this www started to think about new project written in C++ using classes somewhere in August 2002. Some first source was written in October 2003 (16-10-2003 can be taken as start...
245.76 KB  
Programming  -  devkitPro 1.5.7
This project is for homebrew console development tools based on the gnu compiler collection with additional tools and libraries to aid programming each supported console. The windows variants are built with MinGW.
444.26 KB  
Development Tools  -  DotPHP 1.0
DotPHP is the next step of the Web Components project. DotPHP contains web components ver 3.00. or better. DotPHP want be lor better. DotPHP wanPHI or C . It mean developer can make web site only with components. Where are some limits of course....
 
Libraries  -  GODI 20060118
GODI library provides an advanced programming environment for the Objective Caml (OCaml) language. From INRIA (who created OCaml) you can get the OCaml compiler and runtime system, but this is usually not enough to develop applications. You also...
1.5 MB  
Programming  -  Step 1.0
Step is to create and organize TEXT in a strict and linear fashion. The creative possibilities are as large and endless as the next Step.
119.29 KB  
Card Games  -  SolitaireCryptoDemo 1.2
SolitaireCryptoDemo is a visual demonstration of the steps involved in generating a keystream using Bruce Schneier's Solitaire encryption algorithm. Featuring smooth animations and descriptions of all steps. Example...
2.14 MB  
Utilities  -  PowerPAQ 1.0
PowerPAQ will be GUI application that will use strenght of GPL-licensed PAQ compression algorithm. This algorithm is slow but extremely powerful.First, windows version will be out. Next step is Linux GUI version.
133.12 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB