COMP 1005 Lecture 14: Lecture 14

16 views6 pages

Document Summary

Know how an iterative problem can be converted into a recursive problem. A recursive function is any function that calls itself. Every recursive function must have a base case and a recursive case. A base case does not call the function again. A recursive case calls the function again but with different input. We need to specify how to stop the recursion. We specify the cases when we don"t need to solve a smaller problem. When we reach a base case, the recursion stops. The formula n(n-1)! applies when n > 1. We set aside, 4x, 3x, 2x, and 1x (x stands for multiplication, since it"s being multiplied). = 1, so the last expression is 1(1) which equals 1. = 1, we can evaluate the second last expression. If you keep doing this, you will find that 3! The fibonacci sequence is the following series of numbers:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents