Algorithm(n):
i = 1 , k = 0
while i <= n {
for (j = 1 to n/i){
k = k+1
}
i = i * 2
}
I understand outer loop works logn, i'm not sure but for inner loop it is working like n/i + n/i/2 .. n/i/2^n . (it is not logn because We are updating i in outer loop)
i don't know how to combine them, because time complexity of inner loop changes at every loop.
Can anyone help me about this? What is the time complexity