Recursion Flashcards

(7 cards)

0
Q

What’s a “general case”?

A

A general case is the solution in terms of itself for value “n”

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

What’s a recursive routine

A

A recursive routine is a routine which calls itself

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

What’s a base case

A

A base case is a value that has a solution which does not involve any reference to the general case solution.

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

What’s a stack frame

A

A stack frame is the locations in the stack area used to store the values referring to one invocation of a routine

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

Explain why maintaining the scope of variable is essential when using recursion

A

Global variables may be modified in ways not intended by the programmer. It is always best to stick to local variable.

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

What sort of data structure is used to keep track of these function calls

A

A stack

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

What is the term used to describe the situation where stacks runs out of space

A

Stack overflow

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