Design and Analysis of Algorithms20805 marksNumerical: Huffman codingHuffman Coding
Suppose that a message contains alphabet frequencies as given below and find Huffman codes for each alphabet. | Symbol | Frequency | |--------|-----------| | a | 30 | | b | 20 | | c | 25 | | d | 15 | | e | 35 |
Suppose that a message contains alphabet frequencies as given below and find Huffman codes for each alphabet.
| Symbol | Frequency |
|---|---|
| a | 30 |
| b | 20 |
| c | 25 |
| d | 15 |
| e | 35 |
[5]
Symbol Frequency ------------------- a 30 b 20 c 25 d 15 e 35 Total frequency $= 30 + 20 + 25 + 15 + 35 = 125$ --- Sort ascending: d(15), b(20), c(25), a(30), e(35) Node db(35) Remaining: c(25), a(30), e(35), db(35) Node ca(55) Remaining: e(35), db(35), ca(55) Node edb(70) Remaining: ca(55), edb(...