Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hash collision
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Collision resolution == {{Main Article|Hash table#Collision resolution}} In hash tables, since hash collisions are inevitable, hash tables have mechanisms of dealing with them, known as collision resolutions. Two of the most common strategies are [[open addressing]] and [[separate chaining]]. The cache-conscious collision resolution is another strategy that has been discussed in the past for string hash tables. [[File:HASHTB12.svg|thumb|275x275px|John Smith and Sandra Dee are both being directed to the same cell. Open addressing will cause the hash table to redirect Sandra Dee to another cell.]] === Open addressing === {{main|Open addressing}} Cells in the hash table are assigned one of three states in this method β occupied, empty, or deleted. If a hash collision occurs, the table will be probed to move the record to an alternate cell that is stated as empty. There are different types of probing that take place when a hash collision happens and this method is implemented. Some types of probing are [[linear probing]], [[double hashing]], and [[quadratic probing]].<ref name=":2">{{Cite journal|last1=Nimbe|first1=Peter|last2=Ofori Frimpong|first2=Samuel |last3=Opoku |first3=Michael |date=2014-08-20 |title=An Efficient Strategy for Collision Resolution in Hash Tables|url=http://dx.doi.org/10.5120/17411-7990 |journal=International Journal of Computer Applications |volume=99|issue=10|pages=35β41|doi=10.5120/17411-7990 |bibcode=2014IJCA...99j..35N|issn=0975-8887|doi-access=free}}</ref> Open Addressing is also known as closed hashing.<ref>{{cite web |title=Closed Hashing |work=CSC241 Data Structures and Algorithms |url=https://www.cs.wcupa.edu/rkline/ds/closed-hashing.html |access-date=2022-04-06 |first=Robert |last=Kline |publisher=West Chester University}}</ref> === Separate chaining === {{further|Hash table#Separate chaining}} This strategy allows more than one record to be "chained" to the cells of a hash table. If two records are being directed to the same cell, both would go into that cell as a linked list. This efficiently prevents a hash collision from occurring since records with the same hash values can go into the same cell, but it has its disadvantages. Keeping track of so many lists is difficult and can cause whatever tool that is being used to become very slow.<ref name=":2" /> Separate chaining is also known as open hashing.<ref>{{cite web |url=https://www.log2base2.com/algorithms/searching/open-hashing.html |title=Open hashing or separate chaining |work=Log{{sub|2}}2}}</ref> === Cache-conscious collision resolution === Although much less used than the previous two, {{harvp|Askitis|Zobel|2005}} has proposed the [[cache (computing)|cache]]-conscious collision resolution method in 2005.<ref>{{cite conference |conference=International Symposium on String Processing and Information Retrieval |last1=Askitis|first1=Nikolas |last2=Zobel |first2=Justin |title=Cache-Conscious Collision Resolution in String Hash Tables |date=2005 |work=String Processing and Information Retrieval SPIRE 2005 |pages=91β102 |place=Berlin, Heidelberg |publisher=Springer Berlin Heidelberg |series=Lecture Notes in Computer Science |volume=3772 |doi=10.1007/11575832_11| isbn=978-3-540-29740-6 |editor1-last=Consens |editor1-first=M. |editor2-last=Navarro |editor2-first=G.}}</ref> It is a similar idea to the separate chaining methods, although it does not technically involve the chained lists. In this case, instead of chained lists, the hash values are represented in a contiguous list of items. This is better suited for string hash tables and the use for numeric values is still unknown.<ref name=":2" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)