Please explain this mcq question from greedy topic quiz

If Huffman tree coded as left child with ‘0’ and right child with ‘1’ from every node then what is the decoded message for 110100?

abc

bcd

acb

bda

Hey @poorva2145
Post the message to be encoded so that we can know the frequencies of the characters and calculate the huffman codes for each character

Oh, I just got the question from the internet, the message given is:
aabbbbabccdddccccbbdd
So the frequency of:
a:3
b: 7
c: 6
d: 5

on calculating the huffman codes using the huffman tree
you’ll get codes for:
a: 00
b: 11
c: 10
d: 01

so the decoded message for 110100 would be
bda
(as per the above huffman codes)

1 Like

But in mcq question, data aabbbbabccdddccccbbdd was not given. Thats why I wasn’t able to find the answer.

1 Like

Without the message or frequencies given, you can obviously not find the answer. So there might be some misunderstanding, the message/frequency has to be given.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.