Home
Scholarly Works
Practical Algorithms for the Longest Common...
Conference

Practical Algorithms for the Longest Common Extension Problem

Abstract

The Longest Common Extension problem considers a string s and computes, for each of a number of pairs (i,j), the longest substring of s that starts at both i and j. It appears as a subproblem in many fundamental string problems and can be solved by linear-time preprocessing of the string that allows (worst-case) constant-time computation for each pair. The two known approaches use powerful algorithms: either constant-time computation of the Lowest Common Ancestor in trees or constant-time computation of Range Minimum Queries (RMQ) in arrays. We show here that, from practical point of view, such complicated approaches are not needed. We give two very simple algorithms for this problem that require no preprocessing. The first needs only the string and is significantly faster than all previous algorithms on the average. The second combines the first with a direct RMQ computation on the Longest Common Prefix array. It takes advantage of the superior speed of the cache memory and is the fastest on virtually all inputs.

Authors

Ilie L; Tinta L

Series

Lecture Notes in Computer Science

Volume

5721

Pagination

pp. 302-309

Publisher

Springer Nature

Publication Date

November 9, 2009

DOI

10.1007/978-3-642-03784-9_30

Conference proceedings

Lecture Notes in Computer Science

ISSN

0302-9743

Labels

View published work (Non-McMaster Users)

Contact the Experts team