Skip to main content
Log in

A programming technique for recursive procedures

  • Published:
BIT Numerical Mathematics Aims and scope Submit manuscript

Abstract

A programming technique is described for ALGOL-like recursive procedures in which parameters and local variables are replaced by variables global to the recursive procedure and declared in a surrounding non-recursive procedure. The stack and time required for execution of a variety of recursive procedures has been determined in the languages ALGOL 60, CORAL 66 and ALGOL 68 both when programmed using this technique and when using parameters. Detailed results are presented for the Ackermann function and for tree manipulation.

The global technique gives considerable savings in stack for all recursions investigated. For call-dominated recursions the technique speeds up the execution time in ALGOL 60 and CORAL 66 by about 25%. In ALGOL 68 the parameterless recursive procedure must be declared in the closed-clause which forms the particular-program rather than in a surrounding procedure in order to achieve a similar improvement in execution time.

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. D. W. Barron,Recursive Techniques in Programming, Macdonald, London, 1968.

    Google Scholar 

  2. Y. Sundblad,The Ackermann Function. A Theoretical, Computational and Formula Manipulative Study, BIT 11 (1971), 107–119.

    Google Scholar 

  3. B. J. Cornelius and G. H. Kirby,Depth of Recursion and the Ackermann Function, BIT 15 (1975), 144–150.

    Google Scholar 

  4. Algol: 16K Disc Compiler, Technical Publication 4129, International Computers Ltd., London, 1969.

  5. Manual for Enhanced CORAL 66 for ICL 1900 Series, Technical Note 15, Royal Military College of Science, Shrivenham, 1973.

  6. P. M. Woodward and S. G. Bond,ALGOL 68-R Users Guide, H.M.S.O., London, 1974.

    Google Scholar 

  7. E. S. Page and L. B. Wilson,Information Representation and Manipulation in a Computer, Cambridge University Press, Cambridge, 1973.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Cornelius, B.J., Kirby, G.H. A programming technique for recursive procedures. BIT 16, 125–132 (1976). https://doi.org/10.1007/BF01931364

Download citation

  • Received:

  • Issue Date:

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

Key words

Navigation