Huffman coding algorithm works on the principle of
- (A)
Randomization of symbols
- (B)
Key based portioning of symbols
- (C)
Hashing of symbols
- (D)
Frequencies of input symbols
Huffman coding algorithm works on the principle of
Randomization of symbols
Key based portioning of symbols
Hashing of symbols
Frequencies of input symbols
ANSWER
Huffman coding works on the frequencies of the input symbols, so the answer is (D).
Official answer: DSource: ISRO's final answer key of 15 May 2026
Huffman coding builds an optimal prefix code for a set of symbols whose occurrence counts (frequencies) are known.
It repeatedly takes the two symbols (or subtrees) with the smallest frequencies and merges them into a new node whose weight is their sum, until a single tree remains.
Code lengths follow tree depth: frequent symbols sit near the root and get short codes, rare symbols sit deeper and get long codes. This greedy strategy minimises , where is the frequency and the code length of symbol .
Option (a) is wrong: nothing in the algorithm is random. Option (b) is wrong: no keys are used to partition symbols. Option (c) is wrong: no hash function or hash table is involved. Only option (d), the frequencies of the input symbols, drives the construction.
KEY IDEA
Huffman's greedy algorithm repeatedly merges the two lowest-frequency nodes, so symbol frequencies alone decide the code lengths and the tree shape.
WATCH OUT FOR
Confusing prefix-code construction with hashing or key-based partitioning because the result is a tree or a lookup table. Huffman uses only how often each symbol occurs.
From the ISRO CS 2025 paper. Every question of this paper · The full paper (PDF, ISRO) · All 2 ISRO Design techniques questions, with notes