Back to photostream

Cuckoo sequence program

Problem Statment

Cuckoo sequence program or Cuckoo Hashing is a method used to solve the problem when a collision occurs in a Hash Table. Collisions are likely of two hash values of a hash function in a table. A collision occurs when two hash values for the same key occurs in the hash function of a table. To resolve that collision we use Cuckoo Hashing.

 

As from the name, Cuckoo Hashing is just derived from some characteristic of a cuckoo, as a chick of the cuckoo shove or pushes the other eggs or the young ones out of the nest to make a place for own. The same we do in Cuckoo Hashing, trying to insert a new key into the hash table we just push the older key to the new place. And that is how Cuckoo Hashing implemented.

Collision

When a new key, which we try to insert in a Hash Table find an already occupied place in a Hash Table. In that case, this situation is called a collision. When a new key indicates a place to be inserted which is already occupied in a Hash Table is called a collision.

 

This situation can be handled by using some of the Collision handling techniques.

 

- Closed Addressing or Separate Chaining

- Open Addressing

 

Closed Addressing or Separate Chaining

The Separated Chaining is one of the techniques to handle collision problems of Hash Tables. In Separate Chaining, the concept is to join a cell to a linked list to store records for the same hash function values.

Open Addressing

Open Addressing is also a method to resolve the problem of collision.

 

www.tutorialcup.com/interview/hashing/cuckoo-hashing.htm

16 views
0 faves
0 comments
Uploaded on November 11, 2021