Analysis of algorithms
· Study questions
Fall, 2010 ·
Department of Computer Science
·
Grinnell College
Consider the Fibonacci sequence defined by recurrence equations (3.22) on page 59 of our textbook.
fibthat takes any natural number as argument and
returns the number in the specified (zero-based) position in the Fibonacci
sequence. Test your code. Express the number of recursive calls required
to compute (fib n) as a function of n.fib procedure,
using a vector to hold previously computed results. Again, express the
number of recursive calls required to compute (fib n) as a
function of n.fib procedure, still using a vector to hold previously
computed results, but filling up the vector in a plausible order.(fib n). Write an iterative version
of fib that works in Θ(1) space.
·
· 
This work is licensed under a Creative Commons
Attribution-ShareAlike 3.0 United States License.
This text is available on the World Wide Web as
http://www.cs.grinnell.edu/~stone/courses/algorithms/study-questions.html
created July 2, 2000 · last revised September 30, 2010