Gagie and Nekrich (2009) gave an algorithm for adaptive prefix-free coding that, given a string $S [1..n]$ over the alphabet $\{1, \ldots, \sigma\}$ with $\sigma = o (n / \log^{5 / 2} n)$, encodes $S$ in at most $n (H + 1) + o (n)$ bits, where $H$ is the empirical entropy of $S$, such that encoding and decoding $S$ take $O (n)$ time. They also proved their bound on the encoding length is optimal, even when the empirical entropy is high. Their algorithm is impractical, however, because it uses complicated data structures. In this paper we give an algorithm with the same bounds, except that we require $\sigma = o (n^{1 / 2} / \log n)$, that uses no data structures more complicated than a lookup table. Moreover, when Gagie and Nekrich's algorithm is used for optimal adaptive alphabetic coding it takes $O (n \log \log n)$ time for decoding, but ours still takes $O (n)$ time.
翻译:Gagie 和 Nekrich (2009年) 给出了适应性前无字编码的算法,根据字母1美元1美元1美元的字符串,ldots,\sigma $= o(n/ log=5/ 2n)$的字符串[1. n]美元,将美元最多(H+1) + o(n) 位数编码为美元,其中H$是美元的经验性辛特质,因此,编码和解码美元需要10美元(n)的时间。它们也证明了在编码长度上的约束是最佳的,即使实验性昆虫高,它们的算法也是不切实际的,因为它使用复杂的数据结构。在本文中,我们给出了一个相同界限的算法,但我们需要$(n+1/ 2}/ log n) 美元,它使用的数据结构比外观表更为复杂。此外,当Gagie和Nekrich的编码算法用于最佳适应性字母(美元)时,它们的算法是用来进行最佳的。