Yasser El Sonbaty
Efficient Algorithms for Updating Huffman Codes
given a list w = [w1,…, wn] of n positive integer symbol weights,a list l = [l1,…,ln] of n corresponding integer codeword lengths, it is required to find the new list l when a new value x is ed inwhen an existing value is d from the list of weights w. the presented algorithm uses the given information about the weightstheir corresponding levels in order to perform the required . no other knowledge about the original huffman tree is assumed to be known. instead of rebuilding the huffman tree, the new algorithm redistributes the weights among the levels to obtain the new huffman code. in many special cases, the d huffman code can be generated with lower complexity than reconstructing the huffman tree from scratch by efficiently using the information of weightstheir levels. in this paper, we present an updating algorithm that requires a linear complexity in many practical cases rather than the o(n log n) needed for reconstructing the huffman tree. we also give a practical o(n log n) implementation for our algorithms.