📖 Explanation
To search for an item not present in a hash table using linear probing, one must probe the sequence starting from the hash index until an empty slot is encountered. The empty slots in the given table are at indices 2,5, and 7.
We analyze the linear probing chains (clusters) of occupied slots:
- Cluster 1: indices {8,9,0,1} leading to the empty slot 2.
- Cluster 2: indices {3,4} leading to the empty slot 5.
- Cluster 3: index {6} leading to the empty slot 7.
If an item hashes to index 8, we compare the key against the contents of slots 8,9,0,1, and finally confirm the absence at index 2. This requires 5 comparisons (4 key comparisons + 1 empty slot check). Other starting positions result in fewer comparisons. Thus, the maximum number of comparisons needed is 5.