Recursion

Fibonacci numbers

Fibonacci numbers are defined recursively by the following equations:

  • F0 = 0
  • F1 = 1
  • Fn = Fn-1 + Fn-2

Write a recursive function that computes the nth Fibonacci number.

Recursive sum

Write a recursive function that receives a list as input and returns the sum of the elements in the list. Do not use a loop!