recursion week Flashcards

1
Q

recursion

A

process of calling a function that is currently executing

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

recursive fucntion

A

a function that calls itself to solve a problem

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

base case

A

a conditional branch in a recursive function that does not make a recursive call

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

mathematical induction

A

a function P(n) can be proved true by proving the basis (that P(1) is true) and the inductive (showing that p(k) is true if P(k - 1) is true)

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

propositional function

A

a function P(x) that returns true or dalse depending on the value of x

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

Euclids algorithm for greatest common divisor

A

if b=0 GCD is a
else the GCD is the GCD of b and the remainderr from dividing a by b
where a and b are positive ints

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

when to use recursion

A

when it significantly simplifies the implementation and has no significant impact on the run time

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