array

A sequence of same-sized slots stored one after another in a single block of memory, so any slot can be reached by its index directly.

In more detail

Because the address of slot k is the start address plus k times the slot size, reading any element by index takes constant time. The price is that inserting or deleting near the front shifts everything after it. Most languages build their growable lists on arrays, and some, such as JavaScript, use the name array for such a flexible list of values.

Examples

Python's list is an array of pointers; array.array('i', ...) stores raw four-byte integers.
var octets [4]byte

Related terms

Taught in

References