formulation to see thisobserve that factorial( ( factorial( thuswe can define factorial( in terms of factorial( in generalfor positive integer nwe can define factorial(nto be *factorial( this leads to the following recursive definition this definition is typical of many recursive definitions firstit contains one or more base caseswhich are defined nonrecursively in terms of fixed quantities in this casen is the base case it also contains one or more recursive caseswhich are defined by appealing to the definition of the function being defined observe that there is no circularity in this definitionbecause each time the function is invokedits argument is smaller by one recursive implementation of the factorial function let us consider java implementation of the factorial function shown in code fragment under the name recursivefactorial(notice that no looping was needed here the repeated recursive invocations of the function takes the place of looping code fragment the factorial function recursive implementation of we can illustrate the execution of recursive function definition by means of recursion trace each entry of the trace corresponds to recursive call each new recursive function call is indicated by an arrow to the newly called function when the function returnsan arrow showing this return is drawn and the return value may be indicated with this arrow an example of trace is shown in figure what is the advantage of using recursionalthough the recursive implementation of the factorial function is somewhat simpler than the iterative versionin this case there is no compelling reason for preferring recursion over iteration for some