Recursion Objective
What is a Recursion Example of Recursion Tracing a Recursion Stack used in Recursion Time complexity of recursion Recurrence Relation A functions is calling itself. A recursion always have a base c…
Recursion Objective
- What is a Recursion
- Example of Recursion
- Tracing a Recursion
- Stack used in Recursion
- Time complexity of recursion
- Recurrence Relation
What is Recursion?
- A functions is calling itself.
- A recursion always have a base condition, otherwise result to infinite loop.
- The base condition terminates the function.
type fun(param) {
if(n > 0){
printf("%d", n);
fun(n-n);
}
}
void main(){
int x = 3;
fun1(x);
}
how do trace a recursive function?
- It traced as a tree.
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;Last updated on May 15th, 2025