A fast HashTable built with the purpose of implementing a fast search on account of accuracy.
- M - number of bits for hash table
- K - number of hash functions
- inputFile - comma separated (.csv) file serves as input for table building
- testFile - comma separated (.csv) file serves as input for table testing
The table is built of M bits and K hash functions (user input).
Each of the hash functions' output is distributed uniformly over [0..M-1].
Meaning each hash calculation has an equal chance of
The table starts out with all M bits as 0. Whenever a new member is inserted the needed bits are turned on (=1).
Inserting a member into the structure includes a calculation of K hash functions on the given value. Each value from of the K hash functions is translated to turning on the bit in the corresponding index.
In order to test whether the current value is a member of the hash table, the same K hash functions are calculated and the corresponding bits are checked accordingly. Only if all the bits are on, the value is said to be a member.
Therefore, the probability of false positive is 0.
Membership testing consists of the calculation of K hash functions on the given value, uniformly distributed.
Therefore, there is chance of
Therefore, the probability of false negative is