AlgoScope

Matrix

Data structurebeginnerLinear Structuresalso called 2D array, grid

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

Decision · step 3 of 14Matrix: Row-major order
01230121✓23456789101112

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

Open in the player →or start at step 3

What you will see

ROW, COLUMN -> CELL; traversal order across rows; transposition as cells crossing the diagonal.

How matrix works →

Cost

accessO(1)
traverseO(r * c)
SpaceO(r * c)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.

Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.

Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.

Before this

Taught by the same lesson

Matrix covers these too, in the same run.