Presentation is loading. Please wait.

Presentation is loading. Please wait.

General Computer Science for Engineers CISC 106 Lecture 07 James Atlas Computer and Information Sciences 9/18/2009.

Similar presentations


Presentation on theme: "General Computer Science for Engineers CISC 106 Lecture 07 James Atlas Computer and Information Sciences 9/18/2009."— Presentation transcript:

1 General Computer Science for Engineers CISC 106 Lecture 07 James Atlas Computer and Information Sciences 9/18/2009

2 Objectives Use Recursion to Solve Problems

3 Recursive Function Function that refers to itself Example: sum numbers 1 to n function out=sum(n) if n < 1 out = 0; else out = n + sum(n - 1); Termination Condition Simplify Problem, Assemble Results

4 Factorial product numbers 1 to n

5 Fibonacci Sequence F n = F n-1 + F n-2 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,... each number is the sum of the two previous numbers

6 123123123123 5813 2134

7

8

9 Fibonacci Sequence F n = F n-1 + F n-2 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,...

10 Newton’s Method


Download ppt "General Computer Science for Engineers CISC 106 Lecture 07 James Atlas Computer and Information Sciences 9/18/2009."

Similar presentations


Ads by Google