hash tables probe continues until the target is locateda null reference is encounteredor all slots have been examined when either of the latter two situations occursthis indicates the target key is not in the table figure illustrates the searches for key which is in the tableand key which is not in the table ( ( figure searching the hash table(aa successful search for key and (ban unsuccessful search for key deletions we've seen how keys are added to the table with the use of the hash function and linear probe for resolving collisions but how are deletions handleddeleting from hash table is bit more complicated than an insertion search can be performed to locate the key in similar fashion as the basic search operation described earlier but after finding the keywe cannot simply remove it by setting the corresponding table entry to none suppose we remove key from our hash table and set the entry at element to none what happens if we then perform search for key the htsearch(function will return falseindicating the key is not in the tableeven though it' located at element the reason for the unsuccessful search is due to element containing null reference from that key having been previously removedas illustrated in figure rememberkey maps to element but when it was addeda new slot had to be found via probe since key already occupied that slot if we simply remove key there is no way to indicate we have to probe past this point when searching for other keys instead of simply setting the corresponding table entry to nonewe can use special flag to indicate the entry is now empty but it had been previously occupied figure incorrect deletion from the hash table