Help write a normal hash function. Everything I found is a bit like double hashing. And there are no examples. Here is the only thing that I found:
- Set i = h1 (K)
- If TABLE [i] is empty, then go to step 6, otherwise, if the required address is used at this address, the algorithm is completed.
- Set c = h2 (K)
- Set i = i - c, if i <0, then i = i + M.
- If TABLE [i] is empty, go to step 6. If the search is located at this address, the algorithm is completed, otherwise it returns to step 4.
- Insert. If N = M - 1, then the algorithm terminates on overflow. Otherwise, increase N, mark the cell TABLE [i] as busy and set the value of the key K to it.
It is not clear which function to take H1 (k) and H2 (k)