| 1. |
Explain any two methods to resolve collision during hashing. |
|
Answer» The two methods to resolve collision during hashing are: Open addressing and Chaining, Open addressing: The simplest way to resolve a collision is to start with the hash address and do a sequential search through the table for an empty location. The idea is to place the record in the next available position in the array. This method is called linear probing. An empty record is indicated by a special value called null. The major drawback of the linear probe method is clustering. Chaining: In this technique, instead of hashing function value as location we use it as an index into an array of pointers. Each pointer access a chain that holds the element having same location. |
|