in Algorithms edited by
493 views
0 votes
0 votes
What is the time complexity of the following function ?
int foo(int num)
    {
    int result=0;
    if(num<=1) return 1;
    else
        {
        for(i=num;i>=1;i--)
            {
            result+=foo(i/3);
            }
        }
    return result;
    }

 

in Algorithms edited by
493 views

4 Comments

i got $\large n^{\frac{log_{3}^{n}+1}{2}}$....
0
0
Can you please explain how?
0
0
Recursive equation=$T(n)=T(\frac{n}{3})+1$

$T(n)=\theta(n^{\log _{3}})$
0
0

Please log in or register to answer this question.

Related questions