1: public V remove(K key) 2: { 3: checkInitialization(); 4: V removedValue = null; 5: 6: int index = getHashIndex(key); 7: index = locate(index, key); 8: 9: if (index != -1) 10: { 11: // Key found; flag entry as removed and return its value 12: removedValue = hashTable[index].getValue(); 13: hashTable[index].setToRemoved(); 14: numberOfEntries--; 15: } // end if 16: // Else not found; result is null 17: 18: return removedValue; 19: } // end remove 20: // Version 4.0