Data Structures and Algorithms20785 marksFactorial, Fibonacci Sequence, GCD, Tower of Hanoi
Write a recursive program to find nth fibonacci number.
Write a recursive program to find nth fibonacci number. [5]
The Fibonacci sequence is defined as: - F(0) = 0 - F(1) = 1 - F(n) = F(n-1) + F(n-2) for n = 2 This is a naturally recursive problem because the definition of F(n) directly refers to smaller instances of itself. Recursive solutions are well-suited for problems that are naturally recursive in stru...