JAVA In out openaddress hash tables we have used linear prob
JAVA: In out open-address hash tables, we have used linear probing or double hashing. Another probing method, which avoids some clustring, is called quadratic probing. The simplest version of quadratic probing works like this: Start by hashing the key to an array index. If their is a collision, then move to the next array index. If there is a second collision, then move forward two more spots through the array. After a third collision, move forward three more spots, and so on. For exemple , suppose a new key hashes to location 327 and this locarion is full. The next loaction we try is 328. If 328 is a second collision, then we move two spots forward to location 330. If 330 is third collision, them we move three spotsforward to location 333. If our calculation of the next spot takes us beyond the end of the array, then we \"wrap around\" to the front of array(similar to double hashing). In genelar, if location i has just caused a collision and we have already examined count lements, then we increase i according to the assignment:
i=(i+count) % data.length;
in this formula, the \"% data.lenfth\" causes the \"wraparound\" to the front of the array. For this approach to work correctly, the capacity must be a power of 2, such as 2^10=1024. Otherwise, the quence of probes does Not correctly examine all array items. For this project, use quadratic hashing to reimplement the hash table from Figure 11.5 on page 592.
Solution
Use this method to get hashIndex based on the hash value
