
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Information about homework 5 for the data structures i course offered by wentworth institute of technology in the spring of 2007. The homework assignment focuses on recursion and implementing ackermann's function. Instructions for the assignment, due date, and contact information for the instructor. Extra credit is offered to students who add a static variable to count the number of times the function is called.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!
COMP380 Section 71 - Data Structures I - Spring, 2007
Instructor: Bob Goldstein (617) 912- bob.goldstein@schepens.harvard.edu http://home.comcast.net/~goldsteinr/Courses/index.html http://goldstein.eri.harvard.edu/courses/index.html http://myweb.wit.edu/goldsteinr/Courses/index.html Due Date: February 27, Hand In: Printout of program code and dialogue of how it runs. Purpose: Purpose: Practice Recursion (This is problem E3 on Page 121 of Kruse, Tondo and Leung) Ackermann's function, defined as follows, is a standard device to determine how well recursion is implemented on a computer. A(0,n) = n+1 for n 0 A(m,0) = A(m-1,1) for m> A(m,n) = A(m-1, A(m,n-1)) for m>0 and n> Write a program to implement this function and test it for the following values of m and n. A(0,0) A(0,9) A(1,8) A(2,2) A(2,0) A(2,3) A(3,2) A(4,2) A(4,3) A(4,0) NOTE – A(4,2), A(4,3) and A(4,0) WILL GIVE TROUBLE. THEY MIGHT CAUSE YOUR COMPUTER TO HANG. If this occurs, please hand in the rest and state in your homework what happened with these cases. Extra Credit: Put a static variable into your program to count the number of times the function is called. As well as printing the value of the function, print out the number of times the function called itself to do the calculation /app/work/qkd9j0-466412-2765033-homework5-doc.doc 1 12/2/2020 12/2/