Name: Anonymous 2012-01-16 8:59
for (I = 0; I < N; I++)
for (J = 0; J < M; J++)
update(Xs[I][J]);or
for (I = 0; I < N; I++)
for (J = 0; J < M; J++)
update(Xs[J][I]);???
for (I = 0; I < N; I++)
for (J = 0; J < M; J++)
update(Xs[I][J]);
for (I = 0; I < N; I++)
for (J = 0; J < M; J++)
update(Xs[J][I]);for (i = 0; i < X; ++i) and for (i = 0; i < X; i++) result in the same thing, I used the example with int var = ++i and int var = i++ to prove the point that i++ and ++i are two very different things and one of them (depending on the compiler/interpreter/whatever) may yield better performance than the other, unless the compiler figures it out.
for (int i = 0; i < size; i++}
array[size / i][size % i] = value;size / 0 and size % 0size = height * width.
size / 0 when that snippet of code isn't even going to cover half of the elements in that array.
% is modulo, even in JSP. <% however is not, but then again, that's not valid syntax in any C-like language.