Optimal Prefix Codes with Fewer Distinct Codeword Lengths are Faster to Construct

preprint2016arXivOpen access

Abstract

A new method for constructing minimum-redundancy binary prefix codes is described. Our method does not explicitly build a Huffman tree; instead it uses a property of optimal prefix codes to compute the codeword lengths corresponding to the input weights. Let nn be the number of weights and kk be the number of distinct codeword lengths as produced by the algorithm for the optimum codes. The running time of our algorithm is O(k⋅n)O(k \cdot n). Following our previous work in \cite{be}, no algorithm can possibly construct optimal prefix codes in o(k⋅n)o(k \cdot n) time. When the given weights are presorted our algorithm performs O(9k⋅log⁡2kn)O(9^k \cdot \log^{2k}{n}) comparisons.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.