2080 7

CSC325 · 2080 · 5 marks

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.

SymbolFrequency
a30
b20
c25
d15
e35

[5]

Design and Analysis of AlgorithmsChapter 4: Greedy AlgorithmsHuffman CodingNumerical: Huffman coding

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(...