Which data structure is commonly used to implement a matrix?

Options

  • A. Array
  • B. Stack
  • C. Queue
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. Array

Detailed Explanation

Correct Answer: A. Array

Explanation: A matrix can be represented using a two-dimensional array.

  • Rows and columns represent the two dimensions.
  • Elements are accessed using two indices.
  • Example: A[2][3] represents an element at row 2 and column 3 in zero-based indexing.