I have a computer assignment that requires me to use 2d arrays and check if the elements are "singleton's" in a double nested for loop. I wrote the loops and singleton function but I am having trouble figuring out what the starting address for a 2d array is.
Here is the formula that I found to find a certain element. Let's call the matrix A:
A[i,j] = A[0,0] + (((i*N) + j)*sizeof(element))
the sizeof(element) I believe is 4, since we're using hexadecimal to represent each value. The input to this function is $a0 = A[9,9].
The problem I am having is I do not know how to represent the beginning of the matrix A[0,0]. Right now I have it as $a0.
Here is the formula that I found to find a certain element. Let's call the matrix A:
A[i,j] = A[0,0] + (((i*N) + j)*sizeof(element))
the sizeof(element) I believe is 4, since we're using hexadecimal to represent each value. The input to this function is $a0 = A[9,9].
The problem I am having is I do not know how to represent the beginning of the matrix A[0,0]. Right now I have it as $a0.