Consider a nested array in java. Does the top level of the array contain references to the inner arrays, or does the memory actually contain the inner arrays themselves?
If you need an illustration, assume I have access to a reverse method, which will reverse an array in place by doing multiple swaps. If I call reverse on the top-level of an M*N nested array, what will that method simply swap references around (an O(m) operation), or will it be swapping entire rows around (an O(m*n) operation)?