1.

How many bits are needed for standard encoding if the size of the character set is X?(a) log X(b) X+1(c) 2X(d) X^2The question was posed to me in an online interview.Origin of the question is Greedy Algorithms in section Greedy Algorithms of Data Structures & Algorithms II

Answer»

Correct answer is (a) LOG X

Easy explanation - If the size of the CHARACTER set is X, then [log X] BITS are needed for REPRESENTATION in a standard encoding.



Discussion

No Comment Found

Related InterviewSolutions