Chapter 18 Flashcards

1
Q

base case

A

A branch of the conditional statement in a recursive function that does not give rise to further recursive calls.

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

infinite recursion

A

A function that calls itself recursively without ever reaching any base case. Eventually, infinite recursion causes a runtime error.

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

recursion

A

The process of calling a function that is already executing.

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

recursive call

A

The statement that calls an already executing function. Recursion can also be indirect — function f can call g which calls h, and h could make a call back to f.

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

recursive definition

A

A definition which defines something in terms of itself. To be useful it must include base cases which are not recursive. In this way it differs from a circular definition. Recursive definitions often provide an elegant way to express complex data structures, like a directory that can contain other directories, or a menu that can contain other menus.

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