Week 9 Lab 11: Exercise 9a on page 525 of the eBook provided here

profilejmmac111

9. The Fibonacci sequence is the series of integers
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 . . .
See the pattern? Each element in the series is the sum of the preceding two items.
There is a recursive formula for calculating the nth number of the sequence:

Fib
if or
Fib Fib if
N
N N
N N N ( )=
=
( − ) + ( − ) >

,
,
0 1
a. Write a recursive method fibonacci that returns the nth Fibonacci number
when passed the argument n.

    • 10 years ago
    • 20
    Answer(0)
    Bids(0)