The Student Room Group

Decision Trees

I'm having trouble figuring these things out. I came across it on a past exam paper, although it's not just the answer I'm after, as I already have that, it's really a sense of understanding I'd appreciate.

The question is as follows:

The multiple instances of the following characters "ACEGORTX" were contained in a message stream, which was originally encoded using 7-bit ASCII. It is to be encoded using Huffman coding and each character has been given the probability of occurring such that A=10, C=6, E=16, G=2, O=10, R=2, T=12, X=1 Draw up a table of Huffman codes (7 marks) and draw a decision tree (5 marks)

And the answer is said to be this:



So far I get that the characters are listed down the side in numerical order, but I really don't get where any of the rest of it comes from.

Can anyone help explain?
Reply 1
The "numbers" like 36, 20 etc are for the "circles" to the right of them, and are the sum of the "numbers" of the two "circles" which are connected to it.

I have no idea what these are, so I can't really tell you much more than the line of text above the diagram does!!

Latest

Trending

Trending