Modify your Ackermann function so that it utilizes memoization. calculate Acker (3,20), Acker(4,0), Acker(4,1).

Recommended Answers

All 7 Replies

So let's suppose I have done what you said and modified my Ackermann function successfully. Now, did you have question, or were you just issuing some kind of Xmas holiday challenge?

James,
Thank you for your input. it is just a challenge question, no more . I promise no more question.
Smain,

I promise no more question.

Sorry, That's not what I meant. Please do ask questions. It's just that your post didn't ask a question, so nobody knew how to answer it.

Implement the Ackermann function in C++ using memoization?

Acker(m,n) = n+1 if m=o, = A(m-1,1) if n=0, = Acker(m-1, Acker(m,n-1)) otherwise.

Adding a question mark doesn't turn a sentence into a question. Your "question" reads like a work order or homework rather than a question.

The second sentence is vague too.

Try this. Share your work so far. Also, if I google a part of your text, I think I see completed code. Of course, give attribution when you lift code from the web.

PS. Read https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question so you get a clear idea how to post here.

Implement the Ackermann function in C++ using memoization?

the function ackerman is :Acker(m,n) = n+1 if m=o, = A(m-1,1) if n=0, = Acker(m-1, Acker(m,n-1)) otherwise.

Who's challenging who and with what and for what purpose? If you're challenging us, you should know something about the material or have some type of an opinion or context or something , none of which appears anywhere in your post.

If YOU'RE being challenged by someone else, that's something else. It comes off as homework disguised as a challenge. Just flat out say what this is about. No one wants to get burned thinking they're solving some interesting challenge if it's just regular old boring homework.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.