COP 3014 Recitation - Week 14

Recursion!

What does recursion mean? Search for "recursion" at Google. Click on Google's "Did you mean" suggestion. References for these examples can be found here.

  1. Compile and run this program and analyze the code.
  2. Remember that dreaded factorial problem at the end of your exam? Try it again by completing this file.
  3. This web page explains what Fibonacci numbers are. Complete this file which should recursively compute Fibonacci numbers
  4. This web page explains the Greatest Common Divisor problem. Complete this file which should recursively compute the GCD of two numbers.
  5. Getting a hang of it yet? Now try to solve the The Tower of Hanoi problem. The problem is described briefly here. All you need to do is convert the Function definition on the wikipedia page to C++. This will count the minimum number of steps required in order to solve the Tower of Hanoi. Use this file to begin with.