GATE Computer ScienceModerateGATE CSE · NIELIT
A file uses six symbols with frequencies 5, 9, 12, 13, 16 and 45. What is the total number of bits needed to encode the file with an optimal Huffman code?
- A. 224
- B. 214
- C. 234
- D. 249
Correct answer: A. 224
The internal-node weights created while merging (14, 25, 30, 55, 100) sum to 224 bits.
More Algorithms questions
- In a 0/1 knapsack of capacity 11, the items have (weight, value) = (3,3), (4,4), (5,4), (9,10), (4,4). What is the maximum total value?
- What is the length of a longest common subsequence of PROGRAMMING and ALGORITHM?
- A weighted undirected graph on vertices 0–5 has edges (0,1,4), (0,2,3), (1,2,1), (1,3,2), (2,3,4), (3,4,2), (4,5,6), (3,5,7), (2,5,8)…
- A DAG on vertices 0–5 has edges 0→2, 1→2, 2→3, 2→4, 3→5 and 4→5. How many distinct topological orderings does it have?
- With unit cost for insertion, deletion and substitution, what is the edit distance between INTENTION and EXECUTION?
- Six matrices have dimensions 30×35, 35×15, 15×5, 5×10, 10×20 and 20×25 in a chain. What is the minimum number of scalar multiplications to…