I need your help with time complexity.
I have this recursive function: $$ F(n) = \left\{ \begin{array}{l l} F(n-2) + 10 F\big(\frac{n}{6}\big)^2 + 6 F\big(\frac{n}{7}\big) + \frac{n^4}{5} & \text{if } n > 1\\ 2 & \text{otherwise}\\ \end{array} \right. $$
and I had to do the same thing using recursion in C#, so I came up with this :
public static int F1(int n)
{
if (n > 1) return F1(n - 2) + 10 * F1((int)Math.Pow((n/6),2)) + 6 * F1(n / 7) + ((int)Math.Pow(n,4) / 5);
else return 2;
}
I need help calculating the time complexity of this algorithm, and I don't even know where to start and how to do it, could you please give me a hand?
Thank you for any kind of help.
n * n
. – Yuval Filmus Apr 09 '17 at 06:05n
I'm getting a "stack overflow" error, but I think there is nothing I can do about it, right? Speaking about solving a time complexity, I'm still kind of lost. Are you saying that time complexity for this whole recurrence is $$2^{n^{\log_6 2}}$$ ? – Daniel Apr 09 '17 at 09:00