Stack Exchange
Computer Science Stack Exchange
Questions
Tags
Users
About
Computer Science Stack Exchange
Public
Questions
Tags
Users
About
Find the asymptotic time complexity of the following
Asked
Aug 11 '19 at 06:18
Active
Aug 11 '19 at 06:18
Viewed
17 times
0
while(n>1){ n = sqrt(n); }
Where sqrt returns the root of n. n = 2^k and k is a power of 2.
algorithms|algorithm-analysis
asked Aug 11 '19 at 06:18
Aakash Dasgupta
1
What do you think? What have you tried?
–
Yuval Filmus
Aug 11 '19 at 06:39
My thought process was - let's say at iteration 't' n value becomes equal to 1. So, lets say k = 2^a, then (2^(2^(a-t))) = 1 which gives 2^(a-t) = 0, which is impossible. This is where I got stuck.
–
Aakash Dasgupta
Aug 11 '19 at 06:54
0 Answers
0