An array is a contiguous block of memory holding elements of the same type, indexed from 0. Because elements sit next to each other, the address of element i is computed directly as base + i * elementSize, giving O(1) random access.
Memory layout
text
index: 0 1 2 3 4
+-----+-----+-----+-----+-----+
arr = | 10 | 20 | 30 | 40 | 50 |
+-----+-----+-----+-----+-----+
address: base +4 +8 +12 +16 (4-byte ints)
