-2
$\begingroup$

enter image description here

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?

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

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.

$\endgroup$
4
  • $\begingroup$ 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? $\endgroup$ – Rodrigo Amarante Nov 27 '14 at 13:23
  • $\begingroup$ And can you explain what the number in the nodes can be used for? $\endgroup$ – Rodrigo Amarante Nov 27 '14 at 13:23
  • $\begingroup$ 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. $\endgroup$ – Tom van der Zanden Nov 27 '14 at 13:48
  • $\begingroup$ Note that the lecture notes the OP links explain in detail what happens, and why. $\endgroup$ – Raphael Nov 27 '14 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.