This question already has an answer here:
I have an algorithm here and it wants me to calculate the complexity:
for (i=1;i<n;i++) for (j=1;j<i*i;j++) if (j%i==0) for (k=0;k<j;k++) sum++;
First of all, I think that i have different complexities for best, average and worst case but I don't know how to find them. I have one though and I said that in the best case I will have the 2 fors and count as operation the 'if'. So i have a double sum (ΣΣ 1) with bounds being the values of i,j in the for loops. That's all i did.