0

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.

Raphael
  • 73,212
  • 30
  • 182
  • 400
Daniel
  • 1
  • 1

0 Answers0