Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

one-dimensional array

You are here: irt.org | FOLDOC | one-dimensional array

<types> An array with only one dimension; the simplest kind of array, consisting of a sequence of items ("elements"), all of the same type. An element is selected by an integer index that normally starts at zero for the first element and increases by one. The index of the last element is thus the length of the array minus one.

A one-dimensional array is also known as a vector. It should not be confused with a list. In some languages, e.g. Perl, all arrays are one-dimensional and higher dimensions are represented as arrays of pointers to arrays (which can have different sizes and can themselves contain pointers to arrays and so on).

A one-dimensional array maps simply to memory: the address of an element with index i is

	A(i) = A0 + i * s

where A0 is the base address of the array and s is the size of storage used for each element, the "stride". Elements may be padded to certain address boundaries, e.g. machine words, to increase access speed, in which case the stride will be larger than the amount of data in an element.

(2014-03-22)

Nearby terms: Ondine « one « one-banana problem « one-dimensional array » one-line fix » one-liner wars » ones complement

FOLDOC, Topics, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, ?, ALL

©2018 Martin Webb