in Algorithms
727 views
1 vote
1 vote
What is the time complexity of the below code?

for($k=n^{10};k \geq 5;k=k^{\frac{1}{7}},k=k^2$)

{  $k=k^5;$

    $k=k-10$

}

My answer comes to be $O(log_{\frac{7}{10}}log_5(n^{10}))$

Please verify.
in Algorithms
727 views

4 Comments

@Shubham...
I am getting $2^{nd}$ one and a different answer :(
Each time we are taking $(\frac{10}{7})^{th}$ power of modified $k$ and that last value of k should be $\geq 5$. So shouldn't it be - $((n^{10})^{\frac{10}{7}})^x ?$
0
0
@saumya how?

we are doing everytime k^10/7...if you apply two times than it will be k^(10/7^2)...similarly we are applying it for x times so k^((10/7)^x)..
0
0
Ohh yes. Thank you @Shubham :)
0
0

Please log in or register to answer this question.

Related questions