What is "array"

A array (or arrangement) is an ordered data structure representing a collection of elements (values or variables), each identified by at least one index, stored in contiguous memory regions. It is typically stored so that the position of each element can be computed from its index (or tuple of indices) per meior of a mathematical formula. In some languages (C, Java, etc.) the size of the array must be established beforehand. In others (Python, Lisp, etc.) the array grows dynamically as elements are added.

One-dimensional arrays (i.e. which use a single numeric value as an index) are also commonly called vectors. Multidimensional arrays are also called matrices. When the index is not numerical, but another type of data or even an arbitrary type, it is said in associative array.

Some languages (, , ) have "basic arrays" and collections. Basic arrays are supported by the compiler directly; they have a fixed size and only give access to their elements by index. Collections, such as of Java, are system library classes implemented based on these simple arrays, and have a large number of varied methods. In such cases, the tag should be used for simple arrays questions.

When marking a question with this tag, also mark it with the programming language being used.