2079 7

BIT201 ยท 2079 ยท 5 marks

What are the benefits of using recursion? Write a recursive function to find nth Fibonacci number.

What are the benefits of using recursion? Write a recursive function to find nth Fibonacci number. [5]

Data Structures and AlgorithmsChapter 5: Recursion and Advanced TechniquesRecursion definition and benefits
  1. Simplicity and Readability: Recursive solutions are often cleaner and easier to understand than their iterative counterparts, especially for problems that are naturally recursive (e.g., tree traversal, factorial). 2. Reduces Code Length: Complex problems can be solved with fewer lines of code,...