NIST

associative array

(data structure)

Definition: A collection of items that are randomly accessible by a key, often a string.

See also array.

Note: Implementation: the access method must essentially search for a match. The simplest, but slowest, implementation is to do a linear search over the array for a match.

If that is too slow, and you access the array by number, too, you must create and maintain an index into the array. The index is a dictionary, organized by the content, of indexes into the array.

Author: PEB


Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul Black.

Entry modified 17 December 2004.
HTML page formatted Fri Feb 23 10:06:07 2018.

Cite this as:
Paul E. Black, "associative array", in Dictionary of Algorithms and Data Structures [online], Vreda Pieterse and Paul E. Black, eds. 17 December 2004. (accessed TODAY) Available from: https://www.nist.gov/dads/HTML/assocarray.html