Advances in Computational Sciences and Technology
  • Year: 2010
  • Volume: 3
  • Issue: 1

Recursion in Java: A Quantative Analysis

  • Author:
  • Shubhnandan S. Jamwal, Pawanesh Abrol, Devanand
  • Total Page Count: 8
  • Page Number: 9 to 16

PG Department of Computer Science and IT, University of Jammu, Jammu, J and K State, India - 180006.

Abstract

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.

Keywords

Recursive algorithm, Iteration, Locality of reference, compiler