0

I have the following exercise.

Check if the following matrix is symmetrical. Knowing that a matrix iff A[i][j]==A[j][i] for all positions the matrix is symmetric. A[4][4] = {1, 0, 1, 1, 0, 4, 0, 0, 1, 0, 3, 0, 1, 0, 1, 3};

I do understand how to prove the symmetry using C but I have trouble when implementing it in MIPS, since I do not understand how to translate the idea of ​​A [i] [j] == A [j] [i] using just addresses. The problem is that I can not identify the pattern that address follow when interchanging of [i] [j] to [j] [i] .

GGS
  • 153
  • 2
  • 11
  • 2
    The address of `A[x][y]` is the starting address `A` + an offset. For an `n` by `n` array of 4 byte words, the offset is given by `((x * n) + y) * 4`. – markgz Mar 06 '18 at 01:15
  • I remembered that equation later, but thanks you!! – GGS Mar 07 '18 at 19:02

0 Answers0