In: Computer Science
For the following program fragment, (1) give an analysis of the running time T(n) as a function of n and (2) give a big-O bound on the asymptotic running time (tight bounds for full credit).
Sum = 0;
for (i=0; i< n; i++)
for(j=0; j < i*i; j++)
if(j % i == 0)
for (k=0; k<j; k++)
Sum = Sum + 1;