When implementing a Matrix construct using arrays, which would be more efficient? Using a 1D array, or an array of arrays (2D)?
I would think a 2D is more efficient
I don't think this question can be answered without actually writing sample code and testing the results. For example this question found the following results.
sum(double[], int): 2738 ms (100%)
sum(double[,]): 5019 ms (183%)
sum(double[][]): 2540 ms ( 93%)
Jagged arrays being the fastest, followed by 1 dimensional arrays, followed by multidimensional arrays. Jagged arrays being the fastest is probably not what people would have predicted. These results are probably useless for Java since Java has different optimizations (and no multidimensional arrays in Java).
I would be very careful making assumptions. For example, if you are looping over a row of the 2D array, Java might optimize out the index lookups or out of bounds checking wheares it might not be able to if you are using a 1D array with inline index calculations.
I suggest writing a simple program to test the speeds on the desired platform.