Pré-Publication, Document De Travail Année : 2025

Approximate Cartesian Tree Matching with One Difference

Recherche approchée de motifs d'arbre Cartésien avec une erreur

Résumé

Cartesian tree pattern matching consists of finding all the factors of a text that have the same Cartesian tree than a given pattern. There already exist theoretical and practical solutions for the exact case. In this paper, we propose the first algorithms for solving approximate Cartesian tree pattern matching with one difference given a pattern of length m and a text of length n. We present a generic algorithm that find all the factors of the text that have the same Cartesian tree of the pattern with one difference, using different notions of differences. We show that this algorithm has a O(nm) worst-case complexity and that, for several random models, the algorithm has a linear average-case complexity. We also present an automaton based algorithm, adapting [22], that can be generalized to deal with more than one difference.

Fichier principal
Vignette du fichier
2505.09236v1.pdf (1.22 Mo) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence

Dates et versions

hal-05153678 , version 1 (09-07-2025)

Licence

Identifiants

  • HAL Id : hal-05153678 , version 1

Citer

Bastien Auvray, Julien David, Samah Ghazawi, Richard Groult, Gad M Landau, et al.. Approximate Cartesian Tree Matching with One Difference. 2025. ⟨hal-05153678⟩
1532 Consultations
216 Téléchargements

Partager

  • More