# How do I interpret a binary tree generated using Huffman coding algorithm?

In the lecture note here, a binary tree was generated from the huffman algorithm. However it did not explain what this graph mean.

From this binary tree, what can we say about the encoding for the alpha bets a, c, b, f, e, d?

• Both the lecture notes you link and the Wikipedia article explain it all -- please do at least the most basic research before asking here.
– Raphael
Nov 27 '14 at 14:17

The encoding of a particular character is the sequence of 0's and 1's you encounter on the path from the root to that character.

• If Huffman's encoding scheme is just trying to save space, why don't we just assign 0 to a, 1, to b, 01 to c so and so forth? Nov 27 '14 at 13:23
• And can you explain what the number in the nodes can be used for? Nov 27 '14 at 13:23
• For your first question: how would you tell apart "ab" from "c"? For the second one: the number represents the frequency. The point of Huffman encoding is that some characters might be more common than others. In this particular example "a" is very common so it gets a short code, "e" is very uncommon so it gets a longer code. Nov 27 '14 at 13:48
• Note that the lecture notes the OP links explain in detail what happens, and why.
– Raphael
Nov 27 '14 at 14:20