Everything2
Near Matches
Ignore Exact
Full Text
Everything2

associative array

created by root

(idea) by Noung (2.5 hr) (print)   ?   I like it! Sat Oct 20 2001 at 12:04:02

In computer science, an associative array (a map in C++, a hash in Perl) allows the programmer to store values that are then accessed according to their 'key' - another value that is associated with the value. For instance, I might want to store the name of my pet. I'd add the value "Max", with the key "My Dog's Name". Now, whenever I want to get at the name of my dog, I simply ask the associative array to give me the value of "My Dog's Name".

Keys and values can be of different types, and usually of any type (in C++, this is achieved by the use of templates).

Associative arrays are usually implemented using binary trees, which allow an extremely fast search to take place on the data structure. See binary search tree to find out why.


printable version
chaos

binary search tree hash Perl Windows Scripting Host
Perl 5 Pocket Reference: Data Types autovivification Map Perl: Hashes
hash table Call by reference Case-blind STL string PHP parser code for the nodelist XML
linked list 10 steps to becoming a Perl Ninja dict binary tree
Learning to program awk The Value of a College Degree - Computer Science array
key ECMAScript Negative array indexing RTD
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
After stirring Everything, these nodes rose to the top:
She sketched on paper napkins
Japanese romanization
Fables from the Book of Yelps and Growls
American Indian Religious Freedom Act
Northern Ireland
X-Men
Fake words and broken definitions in dictionaries
Allen Ginsberg
emits showers of sparks
Ford Galaxie
Vaclav Havel's address to the US Congress, 21 February 1990
Howlin' Wolf
The Venerable Bede
New Writeups
Ereneta
Stone Soup, Part Two(person)
jjen
Sorrier than I ever thought I would be(personal)
locke baron
Moskva class antisubmarine cruiser(thing)
Wuukiee
May 15, 2008(idea)
locke baron
Kuznetsov class aircraft carrier(thing)
_lesra
for abby(thing)
Adaptive Child
Annie's garden salsa(recipe)
Simulacron3
Zig-Zag(thing)
Ouzo
Special Grilled Cheese(fiction)
Noung
Tiananmen Square Massacre(idea)
aneurin
Lord St Clair(person)
artman2003
Assholes and Douchebags: A Comparison(person)
locke baron
Tyan Thunder K8WE(thing)
locke baron
Udaloy class destroyer(thing)
Scaevola
Same-sex marriage(idea)
E2 is a by-product of the existence of The Everything Development Company