Monday, March 2, 2009

Repetition with Recursion

Today we will be touching a new programming technique known as recursion.
A method or a function is recursive if it calls itself.
Recursion can be used to replace repetition. We will see how the while loop in the shark chase can be replaced by using recursion.
In the lab you can try to solve the butterfly chase recursively as described in exercise 2, P.250-251.

Homework

No comments: