Segment 14.11 introduced the Fibonacci sequence. Computing this sequence recursively is inefficient and takes too much time. Write two methods that each compute the n term in the Fibonacci sequence by using iteration instead of recursion. One method should use an array to store the Fibonacci numbers. The other method should use three variables to contain the current term in the sequence and the two terms before it. What is the Big Oh for each of your iterative methods? Compare these results with the performance of the recursive algorithm.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here