• A recursive function will pass parameter as a recursive call is called nested recursion.
• A recursive function taking recursive call as its parameter is called nested recursion.
Pseudocode-:
if( condition){
_______
_______
fun(fun(n-1))
}
Example-:
public static int fun(int n){
if(n>100)
return n-10;
else
return fun(fun(n+11));
}
public static void main(String[] args){
int r=fun(95);
}
}
In nested recursion, one of the arguments to the recursive function is the recursive function itself! These functions tend to grow extremely fast. A good example is the classic mathematical function, "Ackerman's function. It grows very quickly (even for small values of x and y, Ackerman n(x,y) is extremely large) and it cannot be computed with only definite iteration (a completely defined for() loop for example); it requires indefinite iteration (recursion, for example).
