Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
4951182 | Journal of Computer and System Sciences | 2017 | 10 Pages |
Abstract
In this paper we show how to construct a data structure for a string S of size N compressed into a context-free grammar of size n that supports efficient Karp-Rabin fingerprint queries to any substring of S. That is, given indices i and j, the answer to a query is the fingerprint of the substring S[i,j]. We present the first O(n) space data structures that answer fingerprint queries without decompressing any characters. For Straight Line Programs (SLP) we get O(logâ¡N) query time, and for Linear SLPs (an SLP derivative that captures LZ78 compression and its variations) we get O(logâ¡logâ¡N) query time. We extend the result to solve the longest common extension problem in query time O(logâ¡Nlogâ¡â) and O(logâ¡âlogâ¡logâ¡â+logâ¡logâ¡N) for SLPs and Linear SLPs, respectively. Here, â denotes the length of the LCE.
Related Topics
Physical Sciences and Engineering
Computer Science
Computational Theory and Mathematics
Authors
Philip Bille, Inge Li Gørtz, Patrick Hagge Cording, Benjamin Sach, Hjalte Wedel Vildhøj, Søren Vind,