Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recursion: The Real Bear Game March 27, 2006. Outline Handouts(1) – Perils of JavaSchools Announcements Properties of Successful Recursive Algorithms.

Similar presentations


Presentation on theme: "Recursion: The Real Bear Game March 27, 2006. Outline Handouts(1) – Perils of JavaSchools Announcements Properties of Successful Recursive Algorithms."— Presentation transcript:

1 Recursion: The Real Bear Game March 27, 2006

2 Outline Handouts(1) – Perils of JavaSchools Announcements Properties of Successful Recursive Algorithms Three Bears + 1 Box Stuffing

3 Successful Recursion Has to Stop Reentrant

4 Three Bears + 1 X = # of bears If X is odd, the new number of bears that you have is 3 * X + 1 If X is even, the new number of bears that you have is X / 2. For all X, does this sequence always converge to 1 bear?

5 Box Stuffing The problem is to exactly (or mostly) fit a box with sets of teddy bears. If you have bears in sets of 1, 2, 3, 5, 10, 15, and 20, can you fit a box with the capacity of 27?


Download ppt "Recursion: The Real Bear Game March 27, 2006. Outline Handouts(1) – Perils of JavaSchools Announcements Properties of Successful Recursive Algorithms."

Similar presentations


Ads by Google