Counting distinct palindromes in a word in linear time

  • Authors:
  • Richard Groult;ílise Prieur;Gwénaël Richomme

  • Affiliations:
  • Université de Picardie Jules Verne, Laboratoire MIS, 33, rue Saint Leu, F-80039 Amiens cedex 1, France;Université de Rouen, LITIS EA-4108, 1, rue Thomas Becket, F-76821 Mont-St-Aignan cedex, France;Université Paul-Valéry Montpellier 3, UFR 4, Département MIAp, Route de Mende, 34199 Montpellier cedex 5, France and LIRMM (CNRS, Univ. Montpellier 2) - UMR 5506, 161, rue Ada, 3409 ...

  • Venue:
  • Information Processing Letters
  • Year:
  • 2010

Quantified Score

Hi-index 0.90

Visualization

Abstract

We design an algorithm to count the number of distinct palindromes in a word w in time O(|w|), by adapting an algorithm to detect all occurrences of maximal palindromes in a given word and using the longest previous factor array. As a direct consequence, this shows that the palindromic richness (or fullness) of a word can be checked in linear time.