I'm studying for an algorithms exam and came upon the problem :
for (i = 0; i < n * n; i++) {
i++;
for (j = 0; j < (log(n) * log(n) * log(n)); j++) {
j++;
}
}
I figure that line 1 costs $ c_1(n^2) $, line 2 costs $ c_2(n^2 - 1) $, line 3 costs $ \sum_{j=0}^{n^2} \log(j)^3 $, and line 4 costs $\sum_{j=0}^{n^2} \log(j)^3 - 1 $. Am I on the right track? If so, what do the summations get simplified to?