EECS 111 Lecture 9: Iterative Recursion Review
Document Summary
Chops off the first element of the list (or accum (= n (first lst))))]))] Our help function takes a list and an accumulated value (in this case, a boolean) For else: make a recursive call on a shorter list (rest list) Take whatever value we have accumulated so far and or it with whether or not n is equal to the first item in the list. or returns true if at least one item is true. or can take two or more arguments; if any of them are true then or is tru. Every time we make a recursive call, we make it on a shorter list. New accumulator value = a combination of our old accumulator value and whether or no the first item in the list is equal to n. Tree recursion - multiple recursive calls in one procedure. ;; returns the corresponding item in the fib sequence.