Metraipolis › archive › dc_36d5166bd972
Hash table — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Hash_table
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-10-15T19:28:51.913Z
- SHA-256 of the archived text
5e285a42bc7d5d1ceafaecfbc1db3f76aeebe9831aeb67da7cc8cff0018d33af- Stable URL of this page
https://metraipolis.com/documento/dc_36d5166bd972
How to cite
Hash table — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Hash_table (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_36d5166bd972 (Metraipolis archive dc_36d5166bd972, sha256 5e285a42bc7d5d1ceafaecfbc1db3f76aeebe9831aeb67da7cc8cff0018d33af)
BibTeX
@misc{dc36d5166bd972,
title = {Hash table — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Hash_table},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_36d5166bd972; sha256 5e285a42bc7d5d1ceafaecfbc1db3f76aeebe9831aeb67da7cc8cff0018d33af},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Hash_table. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
In computer science, a hash table is a data structure that implements an associative array, also called a dictionary or simply map; an associative array is an abstract data type that maps keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found. During lookup, the key is hashed and the resulting hash indicates where the corresponding value is stored. A map implemented by a hash table is called a hash map. Most hash table designs employ an imperfect hash function. Hash collisions, where the hash function generates the same index for more than one key, therefore typically must be accommodated in some way. Common strategies to handle hash collisions include separate chaining, which stores multiple elements in the same slot using linked lists, and open addressing, which searches for the next available slot according to a probing sequence. In a well-dimensioned hash table, the average time complexity for each lookup is independent of the number of elements stored in the table. Many hash table designs also allow arbitrary insertions and deletions of key–value pairs, at amortized constant average cost per operation. Hashing is an example of a space–time tradeoff. If memory is infinite, the entire key can be used directly as an index to locate its value with a single memory access. On the other hand, if infinite time is available, values can be stored without regard for their keys, and a binary search or linear search can be used to retrieve the element. In many situations, hash tables turn out to be on average more efficient than search trees or any other table lookup structure. For this reason, they are widely used in many kinds of computer software, particularly for associative arrays, database indexing, caches, and sets. Many programming languages provide built-in hash table structures, such as Python’s dictionaries, Java’s HashMap, C++’s unordered_map, and Go maps, which abstract the complexity of hashing from the programmer. Tema degli esploratori: ricerca e scienza aperta (deposito sistematico; ricerca «open data»). Fonte: Wikipedia in inglese, voce «Hash table» — https://en.wikipedia.org/wiki/Hash_table Wikidata Q207440 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q207440 Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Hash_table?action=history). Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza. Estratto dell'introduzione non modificato nel contenuto; revisione 1376684313, consultata il 2026-10-15T18:33:44.674Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 5c11752e698665ea104750833f7fd33e488da868fc77de76e485aba66911c1c2