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) fidi
The question was asked during an interview.
The query is from Greedy Algorithms topic in chapter Greedy Algorithms of Data Structures & Algorithms II