Find the time complexity of the given code.
int count = 0;
for (int i = N; i > 0; i /= 2)
for (int j = 0; j < i; j++)
count++;
in this question we have n+n/2+n/4+n/8…1
so we will have logn terms and each step takes some constant time so why time complexity is not logn