Trace searches through stored identifiers

A job scheduler stores integer identifiers in an 11-slot hash table. Its home index is the initial index assigned to a key, given here by h(k)=k mod 11h(k)=k\bmod 11. Quadratic probing inspects


pi(k)=(h(k)+i2) mod 11,i=0,1,2,…p_i(k)=(h(k)+i^2)\bmod 11,\qquad i=0,1,2,\ldots


The table below is the current state. Every empty slot has never been used, and no entries have been deleted. All stored identifiers were inserted using the stated rule.


Index

Stored identifier

0

empty

1

47

2

empty

3

14

4

25

5

empty

6

17

7

36

8

empty

9

20

10

empty


Complete the search table. Count every inspected slot, including the slot containing the match or the first empty slot. For each result, enter the matching index as an integer, or enter absent if the key is not stored.

Search keySlots inspectedResult
47
58
36
31

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Linear and Quadratic Probing Questions: