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.
Similar content being viewed by others
References
D. W. Barron,Recursive Techniques in Programming, Macdonald, London, 1968.
Y. Sundblad,The Ackermann Function. A Theoretical, Computational and Formula Manipulative Study, BIT 11 (1971), 107–119.
B. J. Cornelius and G. H. Kirby,Depth of Recursion and the Ackermann Function, BIT 15 (1975), 144–150.
Algol: 16K Disc Compiler, Technical Publication 4129, International Computers Ltd., London, 1969.
Manual for Enhanced CORAL 66 for ICL 1900 Series, Technical Note 15, Royal Military College of Science, Shrivenham, 1973.
P. M. Woodward and S. G. Bond,ALGOL 68-R Users Guide, H.M.S.O., London, 1974.
E. S. Page and L. B. Wilson,Information Representation and Manipulation in a Computer, Cambridge University Press, Cambridge, 1973.
Author information
Authors and Affiliations
Rights 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
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF01931364