Fibonacci using Recursion

00:00
EasyRecursionMemoizationDynamic Programming
TCSWiproInfosys

Compute nth Fibonacci using pure recursion. Understand the recursive call tree and identify repeated sub-problems. Optionally add memoization.

Examples

Input → n=5
Output → 5
Input → n=10
Output → 55
Input → n=0
Output → 0
Input → n=1
Output → 1