0
3.3kviews
Apply Huffman Coding for the word MALAYALAM. Give the Huffman code for each symbol.

Mumbai University > Computer Engineering > Sem 3 > Data Structures

Marks: 10M

Year: May 2016

1 Answer
0
130views

Consider Symbol and Frequency table for calculation of given string “MALAYALAM”. | Symbol | Frequency | |--------|-----------| | M | 2 | | A | 4 | | L | 2 | | Y | 1 |

After calculating frequencies, we will create binary tree node for each character and to obtain the code for each symbol we just need to traverse the trees until we get to that symbol and after each step we take to the left, we add a 0 to the code or 1 if we go right.

enter image description here

Symbol Frequency Huffman Code
M 2 000
A 4 1
L 2 10
Y 1 100
Please log in to add an answer.