Question: Given the sequence 1, 1, 2, 3, 5, 8, 13, 21, .. Write a recursive method that computes the n-th term in the sequence. For
Given the sequence 1, 1, 2, 3, 5, 8, 13, 21, .. Write a recursive method that computes the n-th term in the sequence. For example: recSeries(1) returns 1 recSeries(2) returns 1 recSeries(3) returns 2 recSeries(4) returns 3 recSeries(5) returns 5 recSeries(6) returns 8 recSeries(7) returns 13 The header of the method is as follows: public int recSeries(int n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
