Improved Grammar-Based Compressed Indexes
arXiv:1110.4493
Abstract
We introduce the first grammar-compressed representation of a sequence that supports searches in time that depends only logarithmically on the size of the grammar. Given a text that is represented by a (context-free) grammar of (terminal and nonterminal) symbols and size (measured as the sum of the lengths of the right hands of the rules), a basic grammar-based representation of takes bits of space. Our representation requires bits of space, for any . It can find the positions of the occurrences of a pattern of length in in time, and extract any substring of length of in time , where is the height of the grammar tree.