If row-major order is used, how is the following matrix stored in memory? a b…
2023
If row-major order is used, how is the following matrix stored in memory?
a b c
d e f
g h i
- A.
ihgfedcba
- B.
abcdefghi
- C.
cfibehadg
- D.
adgbehcfi
Attempted by 699 students.
Show answer & explanation
Correct answer: B
Answer: b
Explanation: In row-major order, elements are stored row by row. The matrix has three rows: [a b c], [d e f], [g h i]. The correct memory order is a, b, c, d, e, f, g, h, i.