English

Packed Compact Tries: A Fast and Efficient Data Structure for Online String Processing

Data Structures and Algorithms 2017-10-11 v1

Abstract

In this paper, we present a new data structure called the packed compact trie (packed c-trie) which stores a set SS of kk strings of total length nn in nlogσ+O(klogn)n \log\sigma + O(k \log n) bits of space and supports fast pattern matching queries and updates, where σ\sigma is the size of an alphabet. Assume that α=logσn\alpha = \log_\sigma n letters are packed in a single machine word on the standard word RAM model, and let f(k,n)f(k,n) denote the query and update times of the dynamic predecessor/successor data structure of our choice which stores kk integers from universe [1,n][1,n] in O(klogn)O(k \log n) bits of space. Then, given a string of length mm, our packed c-tries support pattern matching queries and insert/delete operations in O(mαf(k,n))O(\frac{m}{\alpha} f(k,n)) worst-case time and in O(mα+f(k,n))O(\frac{m}{\alpha} + f(k,n)) expected time. Our experiments show that our packed c-tries are faster than the standard compact tries (a.k.a. Patricia trees) on real data sets. As an application of our packed c-trie, we show that the sparse suffix tree for a string of length nn over prefix codes with kk sampled positions, such as evenly-spaced and word delimited sparse suffix trees, can be constructed online in O((nα+k)f(k,n))O((\frac{n}{\alpha} + k) f(k,n)) worst-case time and O(nα+kf(k,n))O(\frac{n}{\alpha} + k f(k,n)) expected time with nlogσ+O(klogn)n \log \sigma + O(k \log n) bits of space. When k=O(nα)k = O(\frac{n}{\alpha}), by using the state-of-the-art dynamic predecessor/successor data structures, we obtain sub-linear time construction algorithms using only O(nα)O(\frac{n}{\alpha}) bits of space in both cases. We also discuss an application of our packed c-tries to online LZD factorization.

Keywords

Cite

@article{arxiv.1602.00422,
  title  = {Packed Compact Tries: A Fast and Efficient Data Structure for Online String Processing},
  author = {Takuya Takagi and Shunsuke Inenaga and Kunihiko Sadakane and Hiroki Arimura},
  journal= {arXiv preprint arXiv:1602.00422},
  year   = {2017}
}

Comments

10 pages, 2 figures

R2 v1 2026-06-22T12:40:39.887Z