English

Optimal Prefix Free Code in Linear Time

Data Structures and Algorithms 2017-03-02 v6

Abstract

We describe an algorithm computing an optimal prefix free code from NN unsorted positive integer weights in time linear in the number of machine words holding those weights. This algorithm takes advantage of common non-algebraic instructions, and of specific results on optimal prefix free codes. This result improves over the state of the art complexities of O(NlgN)O(N\lg N) in the algebraic decision tree model and O(NlglgN)O(N\lg\lg N) in the RAM model for the computation of Huffman's codes, a landmark in compression and coding since 1952.

Keywords

Cite

@article{arxiv.1204.5801,
  title  = {Optimal Prefix Free Code in Linear Time},
  author = {Jérémy Barbay},
  journal= {arXiv preprint arXiv:1204.5801},
  year   = {2017}
}

Comments

The algorithm TopDown is incorrect, and it is not clear how to correct it

R2 v1 2026-06-21T20:54:53.480Z