Computer Science EngineeringVery hard
Huffman coding is applied to frequencies 5, 9, 12, 13, 16, 45. What is the total weighted path length (sum of internal node weights)?
- A. 198
- B. 244
- C. 224
- D. 200
Correct answer: C. 224
Merges produce 14, 25, 30, 55 and 100, and 14+25+30+55+100 = 224.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- What is the Theta bound of: for(i=1;i<=n;i++) for(j=1;j<=n;j=2) count++;
- An adjacency matrix representation of a graph with V vertices needs space
- Which hashing technique guarantees O(1) worst-case search time for a static set of keys?
- A singly linked list holds 1->2->3->4->5. After: p=head; while(p->next && p->next->next) p=p->next->next; what is p->data?
- The number of leaf nodes in a perfect binary tree of height 5 (root at height 0) is
- A simple graph has degree sequence 4, 3, 3, 2, 2. How many edges does it have?