RavindraBabu Ravula is trying to send a message to Anand. The following message is:
GATE2018GAATTTEEEE22000011188
What is the average length of bits required for encoding each letter using Huffman coding___?
given solution :
My solution using min heap ?
I am also getting average length 89/29=3 but I am getting 3 bit code for each char.
I am confuse when to use min heap and is there other approach if any ?
In min heap what to do when two char have same frequency ,does we get more than one tree and hence more than one solution?
sorry if it is naive and already discussed