[go: nahoru, domu]

Jump to content

Hash array mapped trie

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by JensPetersen (talk | contribs) at 23:48, 16 August 2010 (fix link to triesearches.pdf). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A hash array mapped trie[1] (HAMT) is an implementation of an associative array that combines the characteristics of a hash table and an array mapped trie[2].

Advantages of HAMTs

Problems with HAMTs

Implementation of a HAMT involves the use of the population count function, which counts the number of ones in the binary representation of a number. This operation is available in many instruction set architectures (where it is sometimes called "CTPOP"), but it is only available in some high-level languages. Although population count can be implemented in software in O(1) time using a series of shift and add instructions, doing so may perform the operation an order of magnitude slower.

Implementations

The programming language Clojure uses a persistent variant of hash array mapped tries for its native hash map type.[3]

References

  1. ^ Bagwell, P. (2001) Ideal Hash Trees. Technical Report, 2001.
  2. ^ Bagwell, P. (2000) Fast And Space Efficient Trie Searches. Technical Report, 2000.
  3. ^ Java source file of Clojure's hash map type.