recursion week Flashcards
recursion
process of calling a function that is currently executing
recursive fucntion
a function that calls itself to solve a problem
base case
a conditional branch in a recursive function that does not make a recursive call
mathematical induction
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)
propositional function
a function P(x) that returns true or dalse depending on the value of x
Euclids algorithm for greatest common divisor
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
when to use recursion
when it significantly simplifies the implementation and has no significant impact on the run time