Abstract:
In order to solve the recursion problems involving several functions, this paper proposes a systematic recursion-removal method. It cuts the calls among different functions through artificial stack and replaces the recursions inside each function with iteration. It also researches on the relation between recursion-removal depth and the programs’ time efficiency. Experiments prove that it can successfully remove the recursion of dominating tree and double the time efficiency before recursion-removal.
Key words:
recursion-removal,
system stack,
artificial stack,
a door with several keys
摘要: 为解决多函数间互相调用的递归问题,提出一种多函数间的递归消除方法。使用人工栈拆除函数间的互相调用,把递归限制在单个函数内,通过一门多锁法解决单个函数内多处出现递归的问题,研究递归消除深度对程序性能的影响。对占优树的递归消除实验表明,该方法可以解决多函数间的递归问题,且其时间效率是递归消除前的2倍。
关键词:
递归消除,
系统栈,
人工栈,
一门多锁
CLC Number:
BO Xin, DAN Chuan. Recursion-removal Method Among Multi-function[J]. Computer Engineering, 2012, 38(3): 37-38,42.
潘欣, 石川. 一种多函数间的递归消除方法[J]. 计算机工程, 2012, 38(3): 37-38,42.