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 14:07

>>107
And just in case you have me filtered...

Geeze, this would be easier if you just wrote some code...

public class Main {

    public static void main(String[] args) {
        int x = 5;
        int y = 0;
        int z = 0;

        try {
            z = x/y;
        } catch (Exception e) {
            System.out.println("Can't divide by zero");
        }
       
    }
}


And the result...

run:
Can't divide by zero
BUILD SUCCESSFUL (total time: 0 seconds)

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