Computer Science > Data Structures and Algorithms
A newer version of this paper has been withdrawn by Jérémy Barbay
[Submitted on 26 Apr 2012 (v1), revised 29 Oct 2012 (this version, v2), latest version 1 Mar 2017 (v6)]
Title:Optimal Prefix Free Code in Linear Time
View PDFAbstract:Given the probabilities of N messages and a number D of output symbols, a prefix free code of minimal redundancy assigns to each message a code string of variable length over alphabet [1..D] such that no code is prefix of another, and the average length of a code is minimized. We describe an algorithm computing an optimal prefix free code from unsorted positive integer weights in time linear in the input encoding size. Our solution takes advantage of non algebraic instructions, such as computing the logarithm integer part and indirect addressing, both supported in constant time in modern architectures. This result improves on the complexities of known solutions in the algebraic model, O(N log N) through Huffman's original proposal or O(kN) through Belal et al.'s proposal (where k is the minimal number of distinct code lengths of some optimal prefix free code for this set of weights); and over the reduction to sorting in the RAM model which yields an O(N log log N) algorithm. Potential applications include compression (JPEG, MP3, MPEG) and transmission solutions.
Submission history
From: Jérémy Barbay [view email][v1] Thu, 26 Apr 2012 01:27:44 UTC (25 KB)
[v2] Mon, 29 Oct 2012 22:00:44 UTC (30 KB)
[v3] Sat, 13 Jul 2013 15:43:18 UTC (36 KB)
[v4] Thu, 13 Feb 2014 10:22:39 UTC (1 KB) (withdrawn)
[v5] Tue, 13 Dec 2016 16:56:03 UTC (1 KB) (withdrawn)
[v6] Wed, 1 Mar 2017 10:10:15 UTC (1 KB) (withdrawn)
References & Citations
export BibTeX citation
Loading...
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.