Skip to main content

Algorithms · Greedy algorithms and exchange proofs

Consider the invalid coding rule that repeatedly combines the two partial trees of…

Problem

Consider the invalid coding rule that repeatedly combines the two partial trees of largest total frequency instead of the two smallest. Construct a family of frequency distributions for which the cost of the resulting binary prefix code divided by the optimal cost is unbounded.

Hint

Use equal frequencies so an optimum can be balanced.

Check your work

Work the problem yourself first. Then open it in Training to check your answer and read the full worked solution.

The answer check and full solution for this problem come with ProofAnvil Practice membership ($19 USD monthly). See membership. Or start with the free Algorithms sample problem: Try the free sample problem.

More Algorithms practice problems

Back to Algorithms

An original ProofAnvil practice problem, written for this course. ProofAnvil is a practice course, not a homework-answer service.