arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1408.6182cs.DS
收藏

小波树与后缀树

Wavelet Trees Meet Suffix Trees

Maxim Babenko, Paweł Gawrychowski, Tomasz Kociumaka, Tatiana Starikovskaya

摘要:

我们提出了一种改进的小波树构造算法,并讨论了它的应用程序的整数键和字符串的排名/选择问题。给定一个长度为n的字符串,在一个大小为$σ\leq n$的字母表上,我们的方法在$O(n \log σ/ \sqrt{\log{n}})$时间内构建小波树,通过$\sqrt{\log n}$的因子改进了最先进的算法。因此,给定n个整数的数组,我们可以在$O(n \sqrt{\log n})$时间内构造一个由$O(n)$机器字组成的数据结构,并且能够在$O(\log n / \log \log n)$时间内回答数组子范围的秩/选择查询。这是一个$\log \log n$ -因素的改善,在查询时间相比,陈和Ptragarcu和一个$\sqrt{\log n}$ -因素的改善,在建设时间相比,Brodal等人。接下来,我们切换到字符串上下文,并提出了一个新的概念,小波后缀树。对于长度为n的字符串w,该数据结构占用$O(n)$字,花费$O(n \sqrt{\log n})$时间来构造,并且同时捕获w的子字符串的组合结构,同时实现有效的自顶向下遍历和二分搜索。特别地,使用小波后缀树,我们能够在$O(\log |x|)$时间内回答以下两个自然类似的子串后缀的排名/选择查询:对于w的子串x和y,计算x的后缀在字典上小于y的数量,并且对于w的子串x和整数k,找到x的第k个字典上最小的后缀。我们进一步表明,小波后缀树允许计算一个运行长度编码的Burrows-Wheeler变换的子串x的w在$O(s \log |x|)$的时间,其中s表示所得到的行程长度编码的长度。这回答了Cormode和Muthukrishnan的一个问题,他们考虑了Lempel-Ziv压缩的类似问题。

英文摘要:

We present an improved wavelet tree construction algorithm and discuss its applications to a number of rank/select problems for integer keys and strings. Given a string of length n over an alphabet of size $σ\leq n$, our method builds the wavelet tree in $O(n \log σ/ \sqrt{\log{n}})$ time, improving upon the state-of-the-art algorithm by a factor of $\sqrt{\log n}$. As a consequence, given an array of n integers we can construct in $O(n \sqrt{\log n})$ time a data structure consisting of $O(n)$ machine words and capable of answering rank/select queries for the subranges of the array in $O(\log n / \log \log n)$ time. This is a $\log \log n$-factor improvement in query time compared to Chan and Pătraşcu and a $\sqrt{\log n}$-factor improvement in construction time compared to Brodal et al. Next, we switch to stringological context and propose a novel notion of wavelet suffix trees. For a string w of length n, this data structure occupies $O(n)$ words, takes $O(n \sqrt{\log n})$ time to construct, and simultaneously captures the combinatorial structure of substrings of w while enabling efficient top-down traversal and binary search. In particular, with a wavelet suffix tree we are able to answer in $O(\log |x|)$ time the following two natural analogues of rank/select queries for suffixes of substrings: for substrings x and y of w count the number of suffixes of x that are lexicographically smaller than y, and for a substring x of w and an integer k, find the k-th lexicographically smallest suffix of x. We further show that wavelet suffix trees allow to compute a run-length-encoded Burrows-Wheeler transform of a substring x of w in $O(s \log |x|)$ time, where s denotes the length of the resulting run-length encoding. This answers a question by Cormode and Muthukrishnan, who considered an analogous problem for Lempel-Ziv compression.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑