














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















Recursion
Recursive Functions
Recursion
Routine Call
Routine Call
Recursive Call
Recursive Call int f( int x) { int y; if (x==0) return 1; else { y = 2 * f(x-1); return y+1; } }
Linear Recursion
Linear Recursion int Factorial( int no) { // error condition if (no < 0) return - 1; // termination condition if (0 == no) return 1; // linear recursive call return no * Factorial(no - 1); }
Tail Recursion int Factorial( int no, int a) { // error condition if (no < 0) return - 1; // termination condition if (0 == no) return 1; // Tail recursive call return Factorial(no - 1, no * a); }
Mutual / Indirect Recursion
Binary / Excessive Recursion
Binary / Excessive Recursion