Chapter

STACS 2006

Volume 3884 of the series Lecture Notes in Computer Science pp 92-103

Distribution-Sensitive Construction of Minimum-Redundancy Prefix Codes

  • Ahmed BelalAffiliated withDepartment of Computer Engineering and Informatics, Beirut Arab University
  • , Amr ElmasryAffiliated withDepartment of Computer Engineering and Informatics, Beirut Arab University

* Final gross prices may vary according to local VAT.

Get Access

Abstract

A new method for constructing minimum-redundancy prefix codes is described. This method does not build a Huffman tree; instead it uses a property of optimal codes to find the codeword length of each weight. The running time of the algorithm is shown to be O(nk), where n is the number of weights and k is the number of different codeword lengths. When the given sequence of weights is already sorted, it is shown that the codes can be constructed using O(log2k− 1 n) comparisons, which is sub-linear if the value of k is small.