Need help with this question [closed]
- by Jaime
Occasionally, multiplying the sizes of nested loops can give an
overestimate for the Big-Oh running time. This result happens when an
innermost loop is infrequently executed. Give the Big-O analysis of the
running time. Implement the following code and run for several values of
N, and compare your analysis with the actual running times.
for(int i = 1; i <= n; i++)
for(int j = 1; j<=i * i; j++)
if(j%i == 0)
for(int k = 0; k < j; k++)
sum++;