© 1990 by British Computer Society
Bidirectional Huffman Coding

1 Department of Applied Mathematics and Computer Science, The Weizman Institute of Science, Rehovot 76100, Israel, 2 Center for Information and Language Studies, University of Chicago, 1100 East 57-th Street, Chicago, IL 60637, USA
Under what conditions can Huffman codes be efficiently decoded in both directions? The usual decoding procedure works also for backward decoding only if the code has the affix property, i.e., both prefix and suffix properties. Some affix Huffman codes are exhibited, and necessary conditions for the existence of such codes are given. An algorithm is presented which, for a given set of codeword lengths, constructs an affix code, if there exists one. Since for many distributions there is no affix code giving the same compression as the Huffman code, a new algorithm for backward decoding of non-affix Huffman codes is presented, and its worst case complexity is proved to be linear in the length of the encoded text.
Received August 1989.
* Department of Applied Mathematics and Computer Science, The Weizmann Institute of Science, Rehovot 76100, Israel
Center for Information and Language Studies, University of Chicago, 1100 East 57-th Street, Chicago, IL 60637, USA