hcdottutorial
Description Program for explaining the Huffman Coding procedure.
Status Stable.
Audience Developers.
License GNU Lesser General Purpose License (LGPL).
Operating System OS Independent.
Language Java - Requires Sun’s Java 1.5 (or newer) Runtime.
Topic Compression, sample code.
Future Looking for feedback; It computes the Huffman tree for a file, but does not write the compressed file.
Download library: hctutorial.jar. Go here for a description of the algorithm.
To run hctutorial, open a command window (on Windows, use Start->Programs->MS-DOS Prompt or Start->All Programs->Accessories->Command Prompt), and enter the following commands:
C:\Windows\> cd directory where you downloaded the JAR file
directory> java -jar hctutorial.jar
The program will prompt you to select a text file to analyze. The program will report the Huffman coding information to the command window.
Jar files have the same format as ZIP archives: you can extract the source with winzip or other zip utility. You may need to change the extension to “zip” before opening it. If you have any suggestions for features or bugs to report, please contact me.
If you get a java.lang.UnsupportedClassVersionError error, it is because you are attempting run this program with a version a Java that is earlier than 1.5.
NOTE: Unlike every other program on this website, this jar file no longer contains the source code inside it. Contact me personally if you need it for non-homework purposes. I took the source out of the jar because too many college students were passing off my code as their own for programming assignments instead of doing their homework for themselves. The instructor does not want to grade my programming skills. Googling for “Huffman Coding” and downloading source does not equate to learning how to program. It is cheating.