Next: Recurse again
Up: Assignment 5: Recursion
Previous: 99 Bottles
- 1.
- Create a new project called Recurse.prj,
again based on the cs151HelloStationery.
- 2.
- The Ackerman function is defined for non-negative integers
as follows:
 |
(1) |
Write a method called ack that takes two ints as
parameters and that computes and returns the value
of the Ackerman function.
- 3.
- Test your implementation of Ackerman by invoking it
from main and printing the return value. Warning: the
return value gets very big very quickly. You should try it
only for small values of m and n (not bigger than 3).
Allen B. Downey
1999-10-06