Associative array


 
 

In computing, an associative array, also known as a map, lookup table, or dictionary, is an abstract data type very closely related to the mathematical concept of a function with a finite domain. Conceptually, an associative array is composed of a collection of keys and a collection of values, and each key is associated with one value. The operation of finding the value associated with a key is called a lookup or indexing, and this is the most important operation supported by an associative array. The relationship between a key and its value is sometimes called a mapping or binding. For example, if the value associated with the key "bob" is 7, we say that our array maps "bob" to 7.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

From the perspective of a programmer using an associative array, it can be viewed as a generalization of an array: While a regular array maps integers to arbitrarily typed objects (integers, strings, pointers, and, in an OO sense, objects), an associative array maps arbitrarily typed objects to arbitrarily typed objects. (Implementations of the two data structures, though, may be considerably different.)

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

The operations that are usually defined for an associative array are:

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

~ Table of Content ~

Introduction
Examples
Data structures for associative arrays
Language support
External links
 


 

~ Related Subjects ~

Array (2) - OO (1) - Computer science (1) - Associative array (1) - Data structure (1) - Mapping (1) - Lookup table (1) - Computing (1) - Abstract data type (1) - Domain (1) - Function (1) -
 

~ Community ~

History Forum
Come and discuss about History, Civilizations, Historical Events and Figures
History Web-Ring
A community of sites, blogs and forums dedicated to History. Do not hesitate to submit your site.