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

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

Serving Software Downloads in 976 Categories, Downloaded 29.547.507 Times

Algorithm::Huffman 0.09

  Date Added: July 09, 2010  |  Visits: 695

Algorithm::Huffman

Report Broken Link
Printer Friendly Version


Product Homepage
Download (86 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....
 
Business  -  62 Buckingham Gate Victoria 1.0.3
Download this app to watch 62 Buckingham Gate come to life through Augmented Reality. 62 Buckingham Gate, developed by Land Securities, is the next step in the transformation of Victoria, London. Requirements: iOS 4.3 or later. Compatible with...
35.2 MB  
Games  -  AvoidJombie2 1.0
This game is the classic game "Raccoon" zombie version. If you eat all the objects you can go to the next step. You can enjoy free all the steps. Requirements: iOS 3.2 or later. Compatible with iPhone, iPad, and iPod touch.
12.9 MB  
Music  -  Chaine FM - Larne 2.1
In 2007, Chaine FM changed Christmas in Larne. In 2012 we brought you the first ever Chaine FM iPhone application. In 2013 we've went the next step up. Now you can see exactly what's happening at the station. Requirements: iOS 7.0 or later....
7.8 MB  
Education  -  Challenge at CBU 3.21.2
Challenge exists to challenge students to take the next step in their spiritual journey. This app is designed to help you connect with a community of people who are taking steps forward in their relationship with Christ. It is full of...
6 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB