The code below is of a java method that iterates through a for loop, also creating a new array every time. I believe the code without the new array instantiation is O(N) but with the new array declaration, I am not sure.
int[] reverseArray(int[] a) {
int[] result = new int[a.length];
for (int i = 0; i < a.length; i++) {
result[a.length - 1 - i] = a[i];
}
int[][] 2DArray = new int[a.length][a.length/2];
// do something with 2DArray
return result;
}