samedi 9 janvier 2016

How to draw a Huffman tree properly

Vote count: 0

I have the following symbols and probabilities and I would like to draw a Huffman tree for them:

s = 0.04 || i = 0.1 || n = 0.2 || b = 0.04 || a = 0.3 || d = 0.26 || ~ = 0.06

Based on Huffman algorithm, I generated the following tree:

enter image description here

This was done by:

  1. Join s + i
  2. Join the result of 1 and n
  3. Join ~ + d
  4. Join b + a
  5. Join the result of 3 and 4
  6. Join the result of 5 and 2

My questions: is what I have done right or not? If so, is it acceptable that the final probability (result of 6) greater than 1?

Thanks

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



How to draw a Huffman tree properly

Aucun commentaire:

Enregistrer un commentaire