I got this question:
Func(n)
for (a = 1; a <= n; a = a * 2)
for (b = a; b <= n; b = b * 2)
print a + b
I understand the outside loop will run loglog(n), but I have some difficulty understanding how much the inside loop will run. And also what is the final answer to the Time complexity of this function. Thank you all.