Skip to main content

Average-case analysis of pattern-matching in trees under the BST probability model

  • Conference paper
  • First Online:
Book cover Automata, Languages and Programming (ICALP 1994)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 820))

Included in the following conference series:

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 to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. 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.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. Ph. Flajolet and A. Odlyzko, Singularity Analysis of Generating Functions, SIAM Journal on Discrete Mathematics, Vol 3, No.2, May 1990, pp. 216–240.

    Google Scholar 

  5. Ph. Flajolet and J.M. Steyaert, A Complexity Calculus for Recursive Tree Algorithms, Mathematical Systems Theory, 19, 1987, pp.301–331.

    Google Scholar 

  6. I. Goulden and D. Jackson, Combinatorial Enumerations, J. Wiley, New York, 1983.

    Google Scholar 

  7. C.M. Hoffmann, M.J. O'Donnell, Pattern Matching in Trees, Journal of the ACM, Vol 29, No 1, January 1982, pp. 68–95.

    Google Scholar 

  8. D.E. Knuth, The Art of Computer Programming: Sorting and Searching, Vol 3, Addison-Wesley Reading,Mass., 1973.

    Google Scholar 

  9. H. Kron, Practical Subtree Transformational Grammars, Master Thesis, University of California, Santa Cruz, 1974.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. C. Martínez, Statistics Under the BST Model, Tesis doctoral, Marzo 1992, Universidad Politécnica de Cataluna, Spain.

    Google Scholar 

  12. J.M. Steyaert and Ph. Flajolet, Patterns and Pattern-Matching in Trees: An Analysis, Information and Control 58, 1983, pp. 19–58.

    Google Scholar 

  13. 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.

    Google Scholar 

  14. R. Wilhelm, Computation and Use of Data Flow Information in Optimizing Compilers, Acta Informatica 12, 1979, pp. 209–225.

    Google Scholar 

  15. A. Rodríguez-Bernal, Blow-up in a Characteristic Nonlinear Wave Equation. Manuscript.

    Google Scholar 

  16. J.R. Sánchez-Couso, Extension of the Sequential Pattern-Matching to labelled Trees, Report in preparation.

    Google Scholar 

  17. 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.

    Google Scholar 

  18. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Serge Abiteboul Eli Shamir

Rights and permissions

Reprints 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

Publish with us

Policies and ethics