1.

What will be the cost of the code if character ci is at depth di and occurs at frequency fi?(a) cifi(b) ∫cifi(c) ∑fidi(d) fidiThe question was asked during an interview.The query is from Greedy Algorithms topic in chapter Greedy Algorithms of Data Structures & Algorithms II

Answer»

The correct choice is (C) ∑fidi

The best I can EXPLAIN: If character ci is at depth DI and occurs at FREQUENCY fi, the cost of the codeword obtained is ∑fidi.



Discussion

No Comment Found

Related InterviewSolutions