what is the time complexity of:
for (i = 1; i <= n; i = 2*i)
for (j = 0; j < i; j++)
sum++;
? I thought it is O(nlogn) since the otter loop run logn time and the inner loop run i time
what is the time complexity of:
for (i = 1; i <= n; i = 2*i)
for (j = 0; j < i; j++)
sum++;
? I thought it is O(nlogn) since the otter loop run logn time and the inner loop run i time