Previous Issues
Volume :23 Issue : 2 1996
Add To Cart
Download
Recursion and iteration in computer programming
Auther : HANS LOEPER, MADGI EL-GABALI AND PETER NEUBERT
Department of Mathematics and Computer Science, Kuwait University, P. O. Box 5969, 13060 Safat, Kuwait
ABSTRACT
In this paper, a survey on recursive and iterative programming techniques and their interrelationship are addressed. The paper shows that recursive problem solving techniques are powerful, elegant, and natural in many cases. Recursive programming techniques are highly recommended for handling recursive data structures, for using divide and conquer principle, and syntax-oriented design method, etc. On the other hand, there are some problems for which recursive programming may lead to intractable programs, whereas iterative programs may handle these problems in a better manner.
Recursion and iteration are two equivalent ways in programming for repeatedly performing a specific task. Comparison of the execution time between recursive subprograms and their equivalent iterative ones has been performed, results show that the computation time are comparable in a ratio between 0.8 and 1.2. Therefore, there is no significant difference in efficiency between recursive and iterative subprograms. In conclusion, iterative and recursive way of thinking should be performed interchangeably in programming discipline.