Question: 4. Write the Fibonacci sequence as a linear (non-recursive) algorithm. Let the func- tion take in the desired term in the Fibonacci sequence, and return

4. Write the Fibonacci sequence as a linear (non-recursive) algorithm. Let the func- tion take in the desired term in the Fibonacci sequence, and return the appropriate number. For example, the sequence starts as 1, 1, 2, 3, 5, 8, 13,..., so if the number 4 was passed as the argument, 3 would be returned as it is the 4th term in the sequence
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
