O-notation



Please consider the following code:

for (i = 1; i<= n; i++)
for (j = 1; j<=n; j = 2 *j)
for (k = 1; k < n; k = 2 * k)
x = x + 1;

Since this contains two loops tht increments their index by 2*1, 2*2,
2*3 ...2*n, and the outer is linear I would say that the running-time
is n(log n)^2.

Correct?

--

Regards,

Ronny Mandal
.