Recursion Flashcards

1
Q

What is the Recursive Case?

A

The part of the recursive function that has the solution to the problem defined using a smaller case of that same solution (the self-referential bit)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the base case?

A

A solution to a trivially small instance of the problem that ensures that the cycle ends at some point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Run-Time Stack?

A

Each time we call a function, we place a “box” containing its local variables and parameters on top of our stack of boxes (“push”). A function can only access the local variables/parameters in its “box”. When the function ends, we remove its “box” from the stack (“pop”) and continue execution from the calling function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a stack frame?

A

A “box” in the run-time stack that contains the variables in the scope of a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly