CMPSC 122 Chapter Notes - Chapter 4: Binary Search Algorithm, Fibonacci Number, Nested Function
Document Summary
Recursion is an alternate method of achieving repetition. Can often be achieved with the same method as regular function calls. Gives the number of permutations of a sequence of n items. { n * (n - 1)! if n = 0 if n >= 1. Each entry of trace corresponds to a recursive call. Every time a function is called, an activation record or frame is created to store information about the function. Includes information about parameters and local variables. When execution of a function leads to a function call, the activation record saves the current state of the function and pauses at the point of flow the program will return to when the nested function returns. Fractal: a shape that has a self-recursive structure at various levels of magnification. Candidate: an item which, at the current stage of the search, cannot be ruled out as a match to the target.