Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Which loop is faster?

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]);

???

Name: Anonymous 2012-01-16 12:08

Another question.

Which one is faster?

for (int i = 0; i < height; i++}
    for (int j = 0; j < width; j++)
         array[i][j] = value;

or

for (int i = 0; i < size; i++}
    array[size / i][size % i] = value;

Name: Anonymous 2012-01-16 12:11

>>34
First one should be faster, second one should use less memory.

Name: Anonymous 2012-01-16 12:13

>>35
You really need to take a class that covers stuff like runtime analysis.

Name: Anonymous 2012-01-16 12:15

>>35
Also, "less  memory" is ambigious you homo. Dunno about you, but at least to me, there seems to be a difference in memmory ussage if the array does a "write through" instead of a "write back".

Name: Anonymous 2012-01-16 12:15

>>36
Which one?

Name: Anonymous 2012-01-16 12:18

>>39
I think you need to go reexamine your future. Again, programming doesn't seem to be your thing.

Name: Anonymous 2012-01-16 12:18

>>34
Implement it in Java, it should be EASILY DEPLOYABLE AND SCALABLE IN CORPORATE ENVIRONMENTS

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List