Skip to main content
Log in

The average number of registers needed to evaluate a binary tree optimally

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

In this paper we determine the number of binary trees with n leaves which can be evaluated optimally with less than or equal to k registers. Furthermore we obtain the result that this number is equal to the number of the binary trees with n leaves, using for traversal a maximum size of stack less than or equal to 2k+1−1. This fact is only a connection between the numbers of the trees and not between the sets of the trees. We compute also the average number ¯R(n) of registers needed to evaluate a binary tree optimally. We get for all ɛ>0: \(\bar R(n + 1) = 1d(\sqrt {n)} + C + F(n) + O(n^{ - 0.5 + \varepsilon } )\)where C = 0.82574... is a constant and F(n) is a function with F(n) = F(4n) for all n>0 and −0.574<F(n)< −0.492.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Chandrasekharan, K.: Arithmetical Functions, Band 167. Springer-Verlag 1970

  2. deBruijn, N.G., Knuth, D.E., Rice, S.O.: The average height of planted plane trees. In: Graph Theory and Computing, (R.C. Read, Ed.), pp. 15–22. New York-London: Ac. Press 1972

    Google Scholar 

  3. deBruijn, N.G.: On Mahler's partition problem. Koninklijke Nederlandsche Akademie van Wetenschappen, Proceedings Vol. LI, No. 6, 659–669 (1948)

    Google Scholar 

  4. Kemp, R.: The average number of registers needed to evaluate a binary tree optimally. Technical Report A77/04, Universität des Saarlandes, Saarbrücken, 1977

    Google Scholar 

  5. Nakata, I.: On compiling algorithms for arithmetic expressions. Comm. ACM 10, 492–494 (1967)

    Google Scholar 

  6. Sethi, R., Ullman, J.D.: The generation of optimal code for arithmetic expressions. JACM 17, 715–728 (1970)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

After finishing this paper, the author was informed, that P. Flajolet, J.C. Raoult and J. Vuillemin have recently obtained rather similar results by different methods

Rights and permissions

Reprints and permissions

About this article

Cite this article

Kemp, R. The average number of registers needed to evaluate a binary tree optimally. Acta Informatica 11, 363–372 (1979). https://doi.org/10.1007/BF00289094

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00289094

Keywords

Navigation