GATE Computer ScienceModerateGATE CSE · UGC NET
Characters with frequencies 5, 9, 12, 13, 16, 45 are Huffman-coded. What is the total number of bits needed to encode the whole text (sum of frequency × code length)?
- A. 233
- B. 224
- C. 218
- D. 252
Correct answer: B. 224
Successive merges produce 14, 25, 30, 55, 100; the sum of all merged weights is 224.
More Algorithms questions
- Items have weights 3, 4, 5, 6, 2 and values 4, 5, 10, 11, 3. For the 0/1 knapsack with capacity 10, the maximum total value is
- What is the length of a longest common subsequence of X = "ABCBDABXYZ" and Y = "BDCABAZYX"?
- The edit distance (unit-cost insert, delete, substitute) between "algorithm" and "altruistic" is
- Six matrices have dimensions given by the sequence 5, 10, 3, 12, 5, 50, 6 (matrix i is p[i-1] × p[i]). The minimum number of scalar…
- A binary counter starts at 0 and is incremented 1000 times. The cost of an increment is the number of bits that flip. What is the total…
- Unit-time jobs with (deadline, profit): (2,100), (1,19), (2,27), (1,25), (3,15), (3,90), (4,60), (5,10). Each job takes one slot and must…