Any help will be appreciated, as I wasn't able to find much about it online in the last few days and I can't seem to write a suitable recurrence relation for this kind of functions..
Are there any tips or general guidelines for calculating the complexity (time/space) for functions of the following form?
int f1(int n) { if(n < k) // for an arbitrary k return 1; return f1(f1(n/2) + f1(n/3) - f1(n/5)); } Or:
int f2(int n) { if(n < k) return k; return f2(g(n/k)); } int g(int n) { // Some code of known complexity here to calculate an arbitrary c return f2(n/c); } Specifically, recursive functions that call themselves with their own return value as a parameter (e.g func(func(value)); )
Thank you in advance for any assistance provided.