Guten Tag, ich wollte die Ackermannsche Funktion implementieren und habe sie auch implementiert, nur weiß ich nicht ob sie richtig ist. Darum meine Frage, ob ihr mal über meinen Code drüberschauen könntet ob sie richtig ist oder nicht? Hier ist die Ackermannsche Funktion:

und hier ist der code dazu.

und hier ist der code dazu.
Java:
static int variable;
public static int farmguy(int x, int y) {
var stack = new ArrayDequeue<Integer>();
while(stack.isEpmty) {
if(x == 0) {
y.stack.add(variable);
}
if(x < 0 && y == 0) {
y = stack.removeLast(variable);
}
if(x > 0 && y > 0) {
x = stack.removeLast(variable);
y = stack.removeLast(variable);
}
}
return stack;