Compact q-Gram Profiling of Compressed Strings
Compact q-Gram Profiling of Compressed Strings
复制标题
压缩字符串的紧凑 q-Gram 分析
DOI:
10.1007/978-3-642-38905-4_8
复制
发表时间:
2013
期刊:
影响因子:
--
通讯作者:
Inge Li Gørtz
中科院分区:
文献类型:
--
作者:
Philip Bille;Patrick Hagge Cording;Inge Li Gørtz
We consider the problem of computing the q-gram profile of a string T of size N compressed by a context-free grammar with n production rules. We present an algorithm that runs in O (N− α) expected time and uses O (n+ q+ k T, q) space, where N− α≤ q n is the exact number of characters decompressed by the algorithm and k T, q≤ N− α is the number of distinct q-grams in T. This simultaneously matches the current best known time bound and improves the best known space bound. Our space bound is asymptotically optimal in the sense that any algorithm storing the grammar and the q-gram profile must use Ω (n+ q+ k T, q) space. To achieve this we introduce the q-gram graph that space-efficiently captures the structure of a string with respect to its q-grams, and show how to construct it from a grammar.