What is an optimal Hup?man code for the following set of frequencies, based on the first 8 Fibonacci numbers? a:1 b:1 c:2 d:3 e:5 f:8 g:13 h:21 Can you generalize your answer to find the optimal code when the frequencies are the first n Fibonacci numbers?

Respuesta :

Answer:

  • Optimal Huffman code is an encoding algorithm which encodes different symbols using priority queuing

Explanation:

To explain how the Optimal Huffman code works we draw the Huffman tree for the set of symbols and the leaves of the tree are symbols

Note; the right and left moves on the tree starting from the root of the tree to the leaves contain 1 and 1

Also each letter in the tree has a code word from the the root to each letter and the code is called ; Huffman codes.

h : 0

g : 10

f  : 110

e : 1110

d : 11110

c : 111110

b : 1111110

a : 11111110

attached is the Huffman tree

Ver imagen batolisis