Abstract
We analyze the average behaviour under the bst probability model of the simplest and most commonly used sequential tree-matching algorithm. When the uniform probability model for the input is assumed, it is well known that it takes O(n) steps on average to search all occurrences of a random pattern P in a random text T of joint size n. Under the bst probability model the analysis is itself more complex, involving the solution of partial differential equations. Nevertheless the difficulty to solve one of partial differential equations concerned leads us to seek for analytic properties of that solution which allow us to conclude, without the explicit knowledge of that solution, the main result: searching for all occurrences of a random pattern in a random binary tree of joint size n and distributed accordingly to the bst probability model is O(n ln n) on the average.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho and M. Ganapathy, Efficient Tree Pattern Matching: An Aid to Code Generation, Proceedings of the Eleventh ACM Symposium on Principles of Programming Languages, 1984, pp. 334–340.
R. Baeza, R. Casas, J. Díaz and C. Martínez, On the average size of the intersection of binary trees, SIAM Journal on Computing, 21 (1), Feb 1992, pp.24–32.
R. Casas, J. Díaz and C. Martínez, Statistics on Random Trees. In J. Leach, B. Monien and M. Rodríguez-Artalejo editors, 18th Int. Colloquium on Automata, Languages and Programming, Springer-Verlag, Lectures Notes in Computer Science 510, Jul 1991, pp. 186–203.
Ph. Flajolet and A. Odlyzko, Singularity Analysis of Generating Functions, SIAM Journal on Discrete Mathematics, Vol 3, No.2, May 1990, pp. 216–240.
Ph. Flajolet and J.M. Steyaert, A Complexity Calculus for Recursive Tree Algorithms, Mathematical Systems Theory, 19, 1987, pp.301–331.
I. Goulden and D. Jackson, Combinatorial Enumerations, J. Wiley, New York, 1983.
C.M. Hoffmann, M.J. O'Donnell, Pattern Matching in Trees, Journal of the ACM, Vol 29, No 1, January 1982, pp. 68–95.
D.E. Knuth, The Art of Computer Programming: Sorting and Searching, Vol 3, Addison-Wesley Reading,Mass., 1973.
H. Kron, Practical Subtree Transformational Grammars, Master Thesis, University of California, Santa Cruz, 1974.
C. Martínez, Average-Case Analysis of Equality of Binary Trees Under the BST Probability Model, In L. Budach editor. Fundamentals of Computation Theory, Springer-Verlag, Lectures Notes in Computer Science, 529, 1991, pp. 350–359.
C. Martínez, Statistics Under the BST Model, Tesis doctoral, Marzo 1992, Universidad Politécnica de Cataluna, Spain.
J.M. Steyaert and Ph. Flajolet, Patterns and Pattern-Matching in Trees: An Analysis, Information and Control 58, 1983, pp. 19–58.
J.S. Vitter and Ph. Flajolet Average-case analysis of algorithms and data structures In Jan Van Leeuwen editor, Handbook of Theoretical Computer Science, Vol A, North-Holland, 1990 pp. 410–440.
R. Wilhelm, Computation and Use of Data Flow Information in Optimizing Compilers, Acta Informatica 12, 1979, pp. 209–225.
A. Rodríguez-Bernal, Blow-up in a Characteristic Nonlinear Wave Equation. Manuscript.
J.R. Sánchez-Couso, Extension of the Sequential Pattern-Matching to labelled Trees, Report in preparation.
J.R. Sánchez-Couso and M.I. Fernández-Camacho, Average-case Analysis of Pattern-Matching in Trees Under the BST Probability Model, Report DIA 93/3. Departamento de Informática y Automática. Universidad Complutense de Madrid, Spain.
J.R. Sánchez-Couso and M.I. Fernández-Camacho, On the Average Complexity of Exact Pattern-Matching in Binary Search Trees, Report DIA 94/3. Departamento de Informática y Automática. Universidad Complutense de Madrid, Spain.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sánchez-Couso, J.R., Fernández-Camacho, M.I. (1994). Average-case analysis of pattern-matching in trees under the BST probability model. In: Abiteboul, S., Shamir, E. (eds) Automata, Languages and Programming. ICALP 1994. Lecture Notes in Computer Science, vol 820. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58201-0_67
Download citation
DOI: https://doi.org/10.1007/3-540-58201-0_67
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58201-4
Online ISBN: 978-3-540-48566-7
eBook Packages: Springer Book Archive