Main.Lab8 History

Hide minor edits - Show changes to markup

March 07, 2010, at 08:00 PM MST by 71.196.160.210 -
Changed line 5 from:

Write a recursive function that receives a list as input and returns the sum of the elements in the list.

to:

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!

March 07, 2010, at 07:59 PM MST by 71.196.160.210 -
Added lines 1-16:

Recursion

Recursive sum

Write a recursive function that receives a list as input and returns the sum of the elements in the list.

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.