Generalizing O(log log n) time complexity
问题 I want to generalise how we get O(log log n)` time complexity. Yesterday I asked this question, in which I came to know, this: for(i=1 ; i<n ; i*=2) { ... } leads to O(log n) time complexity. By multiplying by 2 in each iteration, we are essentially taking next power of 2: For O(log n) i=i*2 ============ 1*2 = 2^1 = 2 2*2 = 2^2 = 4 4*2 = 2^3 = 8 and so on So to get O(log log n) time complexity, I need to take next double power (I coined this term "double power" for sake of convenience),