Question: Searching an open addressing hash table Given a key k , the HASH _ SEARCH ( T , k ) procedure searches for the key
Searching an open addressing hash table
Given a key k the HASHSEARCHT k procedure searches for the key k in the hash table
T This hash table is implemented as an array Tm and includes a hash function hk i that, for every key k the probe sequence hkhkhkm is a permutation of m The HASHSEARCHT k procedure returns the index j where the key k is found or NIL if the key is not in the hash table. Identify the missing piece of code.
HASHINSERTT k
i
repeat
j hk i
if Tril BE NIL
return j
else
until i as m error "hash table overflow"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
