link to the main question:
https://www.chegg.com/homework-help/questions-and-answers/hash-tables-java-provided-four-items-question-e-1-dictionaryinterfacejava-2-hasheddictiona-q37281962?trackid=kX6ehlfT
HashedDictionary.java part 2:
/*
* We have completed this method for you, and you do not
* have to modify it. Precondition: checkIntegrity has beencalled.
*/
private intquadraticProbe(int index, K key)
{
boolean found = false;
int availableIndex = -1; // Index of firstavailable location (from which an entry was removed)
int increment = 1; // For quadratic probing
while ( !found && (hashTable[index] !=null) )
{
if ((hashTable[index] !=null) && (hashTable[index] !=AVAILABLE))
{
if (key.equals(hashTable[index].getKey()))
found = true; // Key found
else // Follow probe sequence
{
index = (index + increment) % hashTable.length; //Quadratic probing
increment = increment + 2; // Odd values forquadratic probing
}
}