CLO4 Questions total 20-marks: Recognize problems for which recursion applies and be able to implement recursive solutio
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
CLO4 Questions total 20-marks: Recognize problems for which recursion applies and be able to implement recursive solutio
Questions total 20-marks: Recognize problems for which recursion applies and be able to implement recursive solutions. (60 minutes) Q3. Write a java program which will implement the Fibonacci sequence: f(n) = f(n-1) + f(n-2) f(1) = 1, f(0) = 0 For example: f(2)= f(1) + f(0) = 1+0=1 f(3) = f(2) + f(1) = 1 + 1 = 2 f(4) = f(3) + f(2)=2+1=3 (10 marks) public static int fibN(int n) { // write your code below
CLO4