Machine-translated by Google. Questions are authored in English.
Top

Discussion

Row major order stores the elements of a two dimensional array

  • A.one complete column after another in consecutive locations
  • B.in an order determined by the target machine at run time
  • C.in a hash table indexed by the pair of subscripts
  • D.one complete row after another in consecutive locations

Answer: D

The last subscript varies fastest in row major order. C and its relatives use it while Fortran uses column major, which matters when arrays are passed between languages. Mixing the two conventions silently transposes the data.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.