Computing Longest Previous Factor in linear time and applications

  • Authors:
  • Maxime Crochemore;Lucian Ilie

  • Affiliations:
  • Department of Computer Science, King's College London, London WC2R 2LS, UK and Institut Gaspard-Monge, Université Paris-Est, F-77454 Marne-la-Vallée Cedex 2, France;Department of Computer Science, University of Western Ontario, N6A 5B7, London, Ontario, Canada

  • Venue:
  • Information Processing Letters
  • Year:
  • 2008

Quantified Score

Hi-index 0.90

Visualization

Abstract

We give two optimal linear-time algorithms for computing the Longest Previous Factor (LPF) array corresponding to a string w. For any position i in w, LPF[i] gives the length of the longest factor of w starting at position i that occurs previously in w. Several properties and applications of LPF are investigated. They include computing the Lempel-Ziv factorization of a string and detecting all repetitions (runs) in a string in linear time independently of the integer alphabet size.