Are Open Addressing in Hash Tables only useful for searching ? How do the elements get into the HashTable in the very first place?
Asked Answered
H

1

0

From Wikipedia link on Open Addressing :

Open addressing, or closed hashing, is a method of collision resolution in hash tables. With this method a hash collision is resolved by probing, or searching through alternate 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.1 .

I have two questions on this .

  1. What is the intuition for using the fancy term open addressing and closed hashing?
  2. Is this open addressing method useful only for searching but also for insertion ?
Headcheese answered 17/8, 2012 at 12:1 Comment(2)
See #9124831 for your 1. questionLiatrice
When you have a collision on insertion, then you'll need to follow the probing algorithm to find an additional space that is unoccupied.Natal
S
0

I am a bit late to the party but it the term closed hashing refers to the fact that the items are 'closed', that is contained within the hash tables array, they are not stored externally like with chaining (also confusingly called Open Hashing).

Open addressing is used with insertion as well as for searching if you read page 270 of CLRS it is described there.

Snowden answered 29/12, 2020 at 20:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.