Calculate the complexity of the following C++ code fragment: [3]
count = 0;
for (i = 1; i <= n; i *= 2)
for (j = 1; j <= i; j++)
2
count++;
Note: You are required to show all your workings.
count = 0;
for (i = 1; i <= n; i *= 2)
for (j = 1; j <= i; j++)
2
count++;
Note: You are required to show all your workings.
Comment