## Abstract

The Range LCP problem is to preprocess a string S[1…n], to enable efficient solutions of the following query: given a range [l, r] as the input, report max_{i,j∈{l,…,r}} |LCP(S_{i}, S_{j})|. Here LCP(S_{i}, S_{j}) is the longest common prefix of the suffixes of S starting at locations i and j and |LCP(S_{i}, S_{j})| is its length. We study a natural extension of this problem, where the query consists of two ranges. Additionally, we allow a bounded number (say k ≥ 0) of mismatches in the LCP computation. Specifically, our task is to report the following when two ranges [ℓ_{1}, r_{1}] and [ℓ_{2}, r_{2}] comes as input: max _{{ℓ1≤i≤r1,ℓ2≤j≤r2}} |LCP_{k}(S_{i}, S_{j})| Here LCP_{k}(S_{i}, S_{j}) is the longest prefix of S_{i} and S_{j} with at most k mismatches allowed. We show that the queries can be answered in O(k) time using an O(n^{2}/w) space data structure, where w is the word size. We also present space efficient data structures for k = 0 and k = 1. For k = 0, we obtain a linear space data structure with query time O(√n/w log^{ϵ} n), where w is the word size and ϵ > 0 is an arbitrarily small constant. For the case k = 1 we obtain an O(n log n) space data structure with query time O(√ n log n). Finally, we give a reduction from Set Intersection to Range LCP queries, suggesting that it will be very difficult to improve our upper bound by more than a factor of O(log^{ϵ} n).

Original language | English |
---|---|

Title of host publication | String Processing and Information Retrieval - 22nd International Symposium, SPIRE 2015, Proceedings |

Editors | Simon J. Puglisi, Costas S. Iliopoulos, Emine Yilmaz |

Publisher | Springer Verlag |

Pages | 350-361 |

Number of pages | 12 |

ISBN (Print) | 9783319238258 |

DOIs | |

State | Published - 2015 |

Event | 22nd International Symposium on String Processing and Information Retrieval, SPIRE 2015 - London, United Kingdom Duration: 1 Sep 2015 → 4 Sep 2015 |

### Publication series

Name | Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) |
---|---|

Volume | 9309 |

ISSN (Print) | 0302-9743 |

ISSN (Electronic) | 1611-3349 |

### Conference

Conference | 22nd International Symposium on String Processing and Information Retrieval, SPIRE 2015 |
---|---|

Country/Territory | United Kingdom |

City | London |

Period | 1/09/15 → 4/09/15 |

### Bibliographical note

Publisher Copyright:© Springer International Publishing Switzerland 2015.

### Funding

A. Amir—Partly supported by ISF grant 571/14.

Funders | Funder number |
---|---|

Israel Science Foundation | 1147/2011 |

United States-Israel Binational Science Foundation | 2010437 |

Israel Science Foundation | 571/14 |