THE ZEPINT NETWORK

programmer assist

Java Java XML Feeds

Java Questions Java Solutions Java Articles

Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly.

huffman compression in java

DiggBlinkRedditDeliciousTechnorati

question by ashwingz | Moderate

Frequency Table:
D - 2
E - 5
W - 2
S - 1

You will have to write a program to do the following:
? Read in the text to be compressed from the keyboard. Assume it does not contain white space characters and any non-alphabetic characters.

? Calculate the frequency of each character and print out the frequency table as shown in the Introduction.


? Then create the tree using the method explained below.

? Print the encoding table for each character as shown in Introduction. Use non-recursive post-order tree traversal.

? Compression: the encoding table and print out the compressed form of the input text.

? Decompression: Use the compressed form of the text you got in the previous step and expand it using the Huffmann tree created in step 3 (don?t use the encoding table for decompression). You should get the original input text as the output.





Post reply Subscriptions

Re: huffman compression in java

reply by Srirangan

Homework question?

You might want to check out:
-- http://www.developer.com/java/other/article.php/3603066
-- http://www.cs.sfu.ca/CC/365/li/squeeze/Huffman.html

Post reply Subscriptions

Got a Java Question?

Just Sign Up and ask the top Java experts!

Search via Google

User Login

Email Address

Password

Java Experts

Rank Expert Points
#1 Srirangan 100
This a list of the Top Java experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 poizn 100
This is a list of overall best performing experts, how many points do you have?