19 research outputs found

    Algorithms for Computing Abelian Periods of Words

    Full text link
    Constantinescu and Ilie (Bulletin EATCS 89, 167--170, 2006) introduced the notion of an \emph{Abelian period} of a word. A word of length nn over an alphabet of size σ\sigma can have Θ(n2)\Theta(n^{2}) distinct Abelian periods. The Brute-Force algorithm computes all the Abelian periods of a word in time O(n2×σ)O(n^2 \times \sigma) using O(n×σ)O(n \times \sigma) space. We present an off-line algorithm based on a \sel function having the same worst-case theoretical complexity as the Brute-Force one, but outperforming it in practice. We then present on-line algorithms that also enable to compute all the Abelian periods of all the prefixes of ww.Comment: Accepted for publication in Discrete Applied Mathematic

    Fast Computation of Abelian Runs

    Full text link
    Given a word ww and a Parikh vector P\mathcal{P}, an abelian run of period P\mathcal{P} in ww is a maximal occurrence of a substring of ww having abelian period P\mathcal{P}. Our main result is an online algorithm that, given a word ww of length nn over an alphabet of cardinality σ\sigma and a Parikh vector P\mathcal{P}, returns all the abelian runs of period P\mathcal{P} in ww in time O(n)O(n) and space O(σ+p)O(\sigma+p), where pp is the norm of P\mathcal{P}, i.e., the sum of its components. We also present an online algorithm that computes all the abelian runs with periods of norm pp in ww in time O(np)O(np), for any given norm pp. Finally, we give an O(n2)O(n^2)-time offline randomized algorithm for computing all the abelian runs of ww. Its deterministic counterpart runs in O(n2logσ)O(n^2\log\sigma) time.Comment: To appear in Theoretical Computer Scienc

    Counting distinct palindromes in a word in linear time

    No full text
    International audienceWe 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

    Multiplions et divisons avec des bâtons : Les réglettes de Genaille et Lucas.

    No full text
    http://www.apmep.asso.fr/spip.php?page=article&id_article=3624National audienceLes réglettes de Genaille et Lucas ont été inventées par l'ingénieur Henri Genaille en 1885 sur une proposition du mathématicien Édouard Lucas. Il existe des réglettes pour les multiplications et pour les divisions entières. Ces réglettes furent beaucoup utilisées jusque dans les années 1920, période d'apparition des règles à calcul qui précédèrent les calculatrices. Les réglettes présentées dans ce document permettent d'effectuer rapidement de grandes multiplications ou divisions sans calculer de tête. Nous expliquons comment les manipuler et les construire

    Online Computation of Abelian Runs

    No full text
    International audienc

    Online Computation of Abelian Runs

    No full text
    To appear in the Proceedings of LATA 2015Given a word ww and a Parikh vector P\mathcal{P}, an abelian run of period P\mathcal{P} in ww is a maximal occurrence of a substring of ww having abelian period P\mathcal{P}. We give an algorithm that finds all the abelian runs of period P\mathcal{P} in a word of length nn in time O(n×P)O(n\times |\mathcal{P}|) and space O(σ+P)O(\sigma+|\mathcal{P}|)
    corecore