AlgoScope

Matrix

Rows and columns of cells addressed by two indices. Row-major storage.

Data structures, data structure, beginnerAlso called 2D array, grid
Cell 0, 1 is flat index 1.0123012123456789101112
Cell 0, 1 is flat index 1.0123012123456789101112

Matrix: Row-major order

Decision, step 3 of 14

(0, 1) holds 2. Flat index 0 x 4 + 1 = 1.

Cost

Access
O(1)
Traverse
O(r * c)
Space
O(r * c)

Before this

Leads to

Topics that need this one first.

Taught by the same lesson

Matrix covers these too, in the same run.