We just started on Huffman tree's in class and I'm having a few issues. First given the data and frequencies...
Data % / - + *
Frequencies 5 10 25 30 50
Create a custom Huffman tree.
I created...
120
/ \
50 70
/ \
30 40
/ \
15 25
/ \
5 10
And then replaced the frequencies with the corresponding data, but my roommate received a different answer? Am I the one in the wrong here?
Also, I can't seem to wrap my head around this question,
What would the Huffman code look like if all symbols in the alphabet had
equal frequency?
Any and all help is much appreciated!
P.S. These are just study guide questions, not homework related.
EDIT: How I arrived at my answer:
Took 5
and 10
at the bottom of the tree, added those together to get a "ghost" node 15
. Added 25
to the right of that because it is bigger, then created a ghost node 40
by adding those together. put 30
to the left of 40
because it is smaller, and then created a ghost node 70
by adding the two. Finally added 50
to the left of 70
because it was smaller and then created the final ghost node 120
by adding the two.