4.0

4.0 | 2 ratings Rate this file 16 Downloads (last 30 days) File Size: 24.46 KB File ID: #19844
image thumbnail

Visualization of Huffman Encoding Trees

by Jason Agron

 

07 May 2008 (Updated 08 May 2008)

Simple program that builds and visualizes a huffman encoding tree for a user-defined string

| Watch this File

File Information
Description

This program demonstrates how Huffman Encoding works by performing huffman encoding on a user-defined string. The program builds the huffman tree based on user-input and builds a complete huffman tree and code book using built-in MATLAB functions.

A user can edit the string to encode by editing the value of "my_str". The user also has the ability to calculate character probabilities manually or automatically based on ASCII values by changing the "auto_prob" flag and the "prob_dist" variables.

MATLAB release MATLAB 7.5 (R2007b)
Other requirements N/A
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
10 May 2008 en gex  
18 Jan 2011 El amrani Yassine

there is a problem in your code when we use a word contains a letters redundancy example: MOROCCO , we will find that the first c will have a different code of second c and in addition one will be a beginning of the other therefore a violation of the huffman algorithm which is a prefix code

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
compression Jason Agron 22 Oct 2008 10:00:17
huffman Jason Agron 22 Oct 2008 10:00:18
encoding Jason Agron 22 Oct 2008 10:00:18
visualize Jason Agron 22 Oct 2008 10:00:18
binary tree Jason Agron 22 Oct 2008 10:00:18
visualize UAEU 18 Dec 2011 11:18:11

Contact us at files@mathworks.com