Please help understand this huffman coding tutorial (scanned lecture notes attached)

Posted on 2009-05-02
Medium Priority
Last Modified: 2013-11-15
Page one is the algorithm and page 2 is an example.

Off the example, I understand that the the Freq column is organised in descending order then the bottom probabilities are added then the number 8 is brought up to join the 0. But the third column confuses me... how come the 7 is brought down? also the same for the 4th part where the 2 is brought down? Then the 4 and 3 are brought down in the next part?

Also why on the 4th last 6 and 3 is put straight to the top? Why is this?

I cant see the reasons for this mentioned in the algorithm.
Question by:jtiernan2008
  • 3
LVL 85

Expert Comment

ID: 24287886
7 is brought down because when 0 8 and 1 are combined the total frequency is 1300, which is greater than the frequency of 7
LVL 85

Accepted Solution

ozo earned 2000 total points
ID: 24287899
similarly, 2 is brought down because 2130 is greater than 1620
and 6 , 3, and 4 are brought down because 3750 is greater than 2890 or 3340 or 3520
LVL 85

Expert Comment

ID: 24287920
63 goes to the top because their combined frequency, 3340+2890=6250 is greater than any other entry

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question