Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
2-D Arrays (two-dimensional arrays) are rectangular grids or matrices consisting of rows and columns. They allow for storing and accessing elements using two indices - one for row number and another for column number.
Related terms
Multidimensional Arrays: Multidimensional arrays extend beyond two dimensions (rows and columns). For example, a three-dimensional array adds depth as another dimension along with rows and columns.
Jagged Arrays: Jagged arrays are arrays where each row may have different lengths. This allows for more flexibility when dealing with irregularly shaped data structures compared to regular rectangular 2-D arrays.
Array Indexing: Array indexing refers to accessing or modifying elements in an array using their position or indices. In the case of 2-D arrays, you need to specify both the row and column index to access a particular element.