Skip Navigation

You're viewing a single thread.

46 comments
  • Lettme introduce you to ackermann's function:

    int ack(int m, int n) {
        if (m == 0) {
            return n+1;
        } else if((m > 0) && (n == 0)){
            return ack(m-1, 1);
        } else if((m > 0) && (n > 0)) {
            return ack(m-1, ack(m, n-1));
        }
    }
    

    You won't run out of stackoverflows any time soon.

46 comments