// Precondition: checkInitialization has been called.
private int probe(int index, K key)
{
   boolean found = false;
   int removedStateIndex = -1; // Index of first location in removed state

   while ( !found && (hashTable[index] != null) )
   {
      if (hashTable[index].isIn())
      {
         if (key.equals(hashTable[index].getKey()))
            found = true; // Key found
         else             // Follow probe sequence
            index = (index + 1) % hashTable.length; // Linear probing
      }
      else // Skip entries that were removed
      {
         // Save index of first location in removed state
         if (removedStateIndex == -1)
            removedStateIndex = index;

         index = (index + 1) % hashTable.length;    // Linear probing
      } // end if
   } // end while
   // Assertion: Either key or null is found at hashTable[index]

   if (found || (removedStateIndex == -1) )
      return index;             // Index of either key or null
   else
      return removedStateIndex; // Index of an available location
} // end probe
// Version 4.0
