Many problems are solved most readily with recursive algorithms, and recursive algorithms are often shorter and clearer than their iterative counterparts. Recursive algorithm description is typically more elegant and concise than iterative version of the program. The softwares based on recursion are condemned for many years because compilers could not deal efficiently with the overhead of the recursive function call. However, this situation is changing; modern compilers can handle recursion overhead efficiently because of transformation techniques. Performance of computation depends upon construction of compiler, algorithm and hardware design. In this paper we studied the performance of recursive and iterative programs on two different machines and two different versions of JAVA compiler. It has been observed that the performance of the recursive code is 67% better than iterative version.
Recursive algorithm, Iteration, Locality of reference, compiler