#include "inc.h"

static int inchelp(int i, int n)
{	if(n == 0) return i + 1;
	inchelp(i,n-1);
	return inchelp(i,n-1);
}

int inc(int i)
{   static int h = 0;
	return inchelp(i,++h);
}

// inc has linear space complexity and exponential time complexity
// measured by the number of calls to inc.  In other words, each
// time you call it, it requires about twice as much time to compute
// an answer as the previous call.  If the 23rd call takes about 15
// seconds to return, what will be the requirement for the 64th call?
// Would you wait that long for the answer?  If your computer consumes
// 15 watts of power per hour and you pay 10 cents per thousand watt
// hours, what will it cost you for that 64th call?
