Hello,
I'm new here and also new to Computer Sciences. I'm a first semester university student and so far we're only doing mathematics and a lot of theoretical background on computer sciences.
So in one of my assignments we have the option for 120 bonus points but it's pretty much exclusive to those who have programmed before and I find this quite unfair. We complained, so at least one of our tutors helped us in recommending some code snippets. But since I have never coded before I'm totally lost and I really would want to have at least a part of those bonus points.
The question is:
"Calculate the Ackermann Function A for A(8,6). Write down all intermediate data."
Our tutor gave us this hint: I just have no idea what I should do with this?
class Ackermann
{
public static long ackermann( long n, long m )
{
if ( n == 0 )
return m + 1;
else
if ( m == 0 )
return ackermann( n - 1, 1 );
else
return ackermann( n - 1, ackermann(n, m - 1) );
}
public static void main( String args[] )
{
int x = 2,
y = 2;
System.out.println( "ackermann(" + x + "," + y + ")=" + ackermann(x,y) );
}
}
One guy in another study group tried a c++ code, but I don't have the source and I wouldn't even have a clue how to use it...
Help is really appreciated!