encyclopegia.org

Open addressing

Open addressing, or closed hashing, is a method of collision resolution in hash tables.[src] With this method a hash collision is resolved by probing, or searching through alternative locations in the array (the probe sequence) until either the target record is found, or an unused array slot is found, which indicates that there is no such key in the table.[src] Well-known probe sequences include: ; Linear probing : in which the interval between probes is fixed — often set to 1.[src] ; Quadratic probing : in which the interval between probes increases linearly (hence, the indices are described by a quadratic function).[src] ; Double hashing : in which the interval between probes is fixed for each record but is computed by another hash function.[src] The main trade offs between these methods are that linear probing has the best cache performance but is most sensitive to clustering, while double hashing has poor cache performance but exhibits virtually no clustering; quadratic probing falls in between in both areas.[src] Double hashing can also require more computation than other forms of probing.[src] Some open addressing methods, such as Hopscotch hashing, Robin Hood hashing, last-come-first-served hashing and cuckoo hashing move existing keys around in the array to make room for the new key.[src] This gives better maximum search times than the methods based on probing.…[src]

Open addressing, or closed hashing, is a method of collision resolution in hash tables.[src] With this method a hash collision is resolved by probing, or searching through alternative locations in the array (the probe sequence) until either the target record is found, or an unused array slot is found, which indicates that there is no such key in the table.[src] Well-known probe sequences include: Linear probing : in which the interval between probes is fixed — often set to 1.[src] Quadratic probing : in which the interval between probes increases linearly (hence, the indices are described by a quadratic function).[src] Double hashing : in which the interval between probes is fixed for each record but is computed by another hash function.[src] The main trade offs between these methods are that linear probing has the best cache performance but is most sensitive to clustering, while double hashing has poor cache performance but exhibits virtually no clustering; quadratic probing falls in between in both areas.[src] Double hashing can also require more computation than other forms of probing.[src] Some open addressing methods, such as Hopscotch hashing, Robin Hood hashing, last-come-first-served hashing and cuckoo hashing move existing keys around in the array to make room for the new key.[src] This gives better maximum search times than the methods based on probing.[src] A critical influence on performance of an open addressing hash table is the load factor; that is, the proportion of the slots in the array that are used.[src] As the load factor increases towards 100%, the number of probes that may be required to find or insert a given key rises dramatically.[src] Once the table becomes full, probing algorithms may even fail to terminate.[src] Even with good hash functions, load factors are normally limited to 80%.[src] A poor hash function can exhibit poor performance even at very low load factors by generating significant clustering, especially with the simplest linear addressing method.[src] Generally typical load factors with most open addressing methods are 50%, while separate chaining typically can use up to 100%.[src] ==Example pseudocode== The following pseudocode is an implementation of an open addressing hash table with linear probing and single-slot stepping, a common approach that is effective if the hash function is good.[src] Each of the lookup, set and remove functions use a common internal function find_slot to locate the array slot that either does or should contain a given key.[src] record pair { key, value, occupied flag (initially unset) } var pair slot[0], slot[1], ..., slot[num_slots - 1] function find_slot(key) i := hash(key) modulo num_slots // search until we either find the key, or find an empty slot.[src] while (slot[i] is occupied) and (slot[i].key ≠ key) i := (i + 1) modulo num_slots return i function lookup(key) i := find_slot(key) if slot[i] is occupied // key is in table return slot[i].value else // key is not in table return not found function set(key, value) i := find_slot(key) if slot[i] is occupied // we found our key slot[i].value := value return if the table is almost full rebuild the table larger (note 1) i := find_slot(key) mark slot[i] as occupied slot[i].key := key slot[i].value := value note 1 : Rebuilding the table requires allocating a larger array and recursively using the set operation to insert all the elements of the old array into the new larger array.[src] It is common to increase the array size exponentially, for example by doubling the old array size.[src] function remove(key) i := find_slot(key) if slot[i] is unoccupied return // key is not in the table mark slot[i] as unoccupied j := i loop (note 2) j := (j + 1) modulo num_slots if slot[j] is unoccupied exit loop k := hash(slot[j].key) modulo num_slots // determine if k lies cyclically in (i,j] // i ≤ j: | i..k..j | // i > j: |.k..j i....| or |....j i..k.| if i ≤ j if (i EU_n = \frac{1}{2}\left(1+\frac{1}{1-\alpha}\right) + \Theta(\frac{1}{m}) ES_n = \frac{1}{2}\left(1+\frac{1}{(1-\alpha)^2}\right) + \Theta(\frac{1}{m}) Here n is the number of elements in the table, m the table size, \alpha=n/m the load factor, U_n the number of probes in an unsuccessful search and S_n the number of probes in a successful search.[src] Note that the expectation deteriorates to infinity when the load factor approaches 1.[src] ==See also== Lazy deletion – a method of deleting from a hash table using open addressing.[src] ==References==[src]

33 sentences · 33 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Open addressing." encyclopegia.org, 2026, https://encyclopegia.org/wiki/open-addressing. Accessed 29 November 2026.

Chicago

"Open addressing." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/open-addressing.

APA

encyclopegia.org. (2026). Open addressing. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/open-addressing

Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Open Sud de France

stub · references available

U.S. Open Cup

stub · references available

2008 Gerry Weber Open – singles

stub · references available

2007 Gerry Weber Open – singles

stub · references available

2011 Gerry Weber Open – singles

stub · references available

2012 Gerry Weber Open – singles

stub · references available

2009 Gerry Weber Open

stub · references available

2002 NASDAQ-100 Open – men's singles

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1353211902 · 0.5 · snapshot enwiki-001353211902

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.