Skip to main content

Average-case analysis of equality of binary trees under the BST probability model

  • Commanications
  • Conference paper
  • First Online:
Fundamentals of Computation Theory (FCT 1991)

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

Included in the following conference series:

Abstract

In this paper a simple algorithm to test equality of binary trees currently used in symbolic computation, unification, etc. is investigated. When the uniform probability model for the input is assumed, it is well known that it takes O(1) steps on average to decide if the trees in a given pair of total size n are equal or not. The aim of the paper is to analyze this average complexity when the so-called bst probability model is assumed. The analysis is itself more complex although feasible, involving the solution of partial differential equations and singularity analysis of Bessel functions. Nevertheless, since partial differential equations are generally unsolvable, like the one which is derived from the bivariate recurrence for the equality, an indirect mechanism solving a simpler equation and showing asymptotic equivalence of solutions is used to obtain the main result : testing equality of a pair of binary trees of total size n and distributed accordingly to the bst probability model is ⊝(logn) on the average.

This research was partially supported by the ESPRIT BRA Program of the EC under contract no. 3075, project ALCOM.

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. M. Abramowitz and I.A. Stegun. Handbook of Mathematical Functions. Dover Publications, New York, 1964.

    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, 1991. To appear. Also available as Tech. Rep. LSI-89-23, LSI-UPC, Nov 1989.

    Google Scholar 

  3. R. Casas, J. Díaz, and J.M. Steyaert. Average-case analysis of Robinson's unification algorithm with two different variables. Information Processing Letters, 31:227–232, June 1989.

    Google Scholar 

  4. R. Casas, M.I. Fernández, and J.M. Steyaert. Algebraic simplification in computer algebra: an analysis of bottom-up algorithms. Theoretical Computer Science, 74:273–298, 1990.

    Google Scholar 

  5. R. Courant and D. Hilbert. Methods of Mathematical Physics, volume 2. InterScience J. Wiley, 1962.

    Google Scholar 

  6. E.T. Copson. Partial Differential Equations. Cambridge University Press, Cambridge, 1975.

    Google Scholar 

  7. W. Feller. An Introduction to Probability Theory and its Applications, volume 2. J. Wiley, New York, 1971.

    Google Scholar 

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

    Google Scholar 

  9. E.L. Ince. Ordinary Differential Equations. Dover Publications, New York, 1956.

    Google Scholar 

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

    Google Scholar 

  11. J.M. Steyaert and Ph. Flajolet. Patterns and pattern-matching in trees: An analysis. Information and Control, 58, 1–3:19–58, 1983.

    Google Scholar 

  12. 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, pages 410–440. North-Holland, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

L. Budach

Rights and permissions

Reprints and permissions

Copyright information

© 1991 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Martínez, C. (1991). Average-case analysis of equality of binary trees under the BST probability model. In: Budach, L. (eds) Fundamentals of Computation Theory. FCT 1991. Lecture Notes in Computer Science, vol 529. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-54458-5_79

Download citation

  • DOI: https://doi.org/10.1007/3-540-54458-5_79

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-54458-6

  • Online ISBN: 978-3-540-38391-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics