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; } surbhiag asked Jun 27, 2018 • edited Jun 27, 2018 by surbhiag surbhiag 497 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Shaik Masthan commented Jun 28, 2018 reply Follow Share i got $\large n^{\frac{log_{3}^{n}+1}{2}}$.... 0 votes 0 votes Sheth Nisarg commented Jul 18, 2018 reply Follow Share Can you please explain how? 0 votes 0 votes Anand. commented Jul 18, 2018 reply Follow Share Recursive equation=$T(n)=T(\frac{n}{3})+1$ $T(n)=\theta(n^{\log _{3}})$ 0 votes 0 votes Please log in or register to add a comment.