bool insertconst hashedobj /insert as active int currentpos findposx )ifisactivecurrentpos return falsearraycurrentpos element xarraycurrentpos info active/rehashsee section if++currentsize array size rehash)return truebool removeconst hashedobj int currentpos findposx )if!isactivecurrentpos return falsearraycurrentpos info deletedreturn truefigure some insert and remove routines for hash tables with quadratic probing factor exceeds the table is full and we enlarge the hash table this is called rehashing and is discussed in section figure also shows remove although quadratic probing eliminates primary clusteringelements that hash to the same position will probe the same alternative cells this is known as secondary clustering secondary clustering is slight theoretical blemish simulation results suggest that it generally causes less than an extra half probe per search the following technique eliminates thisbut does so at the cost of computing an extra hash function double hashing the last collision resolution method we will examine is double hashing for double hashingone popular choice is (ii hash (xthis formula says that we apply second hash function to and probe at distance hash ( ) hash ( )and so on poor choice of hash (xwould be disastrous for instancethe obvious choice hash (xx mod would not help if were inserted into the input in the previous examples thusthe function must never evaluate to zero it is also important to make sure all cells can be probed (this is not possible in the example belowbecause the table size is not primea function such