Title: Keys
1Linear probing
N - 1
0
1
N - 2
h
h(key)
Keys
2Linear probing
N - 1
0
1
N - 2
h
(h(key) 1) mod N
Keys
3Linear probing
N - 1
0
1
N - 2
h
(h(key) 2) mod N
Keys
4Linear probing
N - 1
0
1
N - 2
h
(h(key) 3) mod N
Keys
5Linear probing
N - 1
0
1
N - 2
h
(h(key) 4) mod N
Keys
6Quadratic probing
N - 1
0
1
N - 2
h
h(key)
Keys
7Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 1) mod N
Keys
8Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 4) mod N
Keys
9Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 9) mod N
Keys
10Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 16) mod N
Keys
11Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 25) mod N
Keys
12Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 36) mod N
Keys
13Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 49) mod N
Keys
14Quadratic probing
N - 1
0
1
N - 2
h
(h(key) 81) mod N
Keys
15Quadratic probing
N - 1
0
1
N - 2
h
h(key)
h(key)
Keys
N 17 (prime)
16Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 1) mod N
Keys
N 17 (prime)
17Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 4) mod N
Keys
N 17 (prime)
18Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 9) mod N
Keys
N 17 (prime)
19Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 16) mod N
Keys
N 17 (prime)
20Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 25) mod N
Keys
N 17 (prime)
21Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 36) mod N
Keys
N 17 (prime)
22Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 49) mod N
Keys
N 17 (prime)
23Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 64) mod N
Keys
N 17 (prime)
24Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 81) mod N
Keys
N 17 (prime)
25Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 100) mod N
Keys
N 17 (prime)
26Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 121) mod N
Keys
N 17 (prime)
27Quadratic probing
N - 1
0
1
N - 2
h
h(key)
(h(key) 144) mod N
Keys
N 17 (prime)
28Quadratic probing
N 17 (prime)
Theorem If quadratic probing is used, and the
table size is prime, then a new element can
always be inserted if the table is at least half
empty.
N - 1
0
1
N - 2
h(key)
Proof In textbook, p. 192.
29Quadratic probing
Theorem If quadratic probing is used, and the
table size is prime, then a new element can
always be inserted if the table is at least half
empty.
N 17 (prime)
N - 1
0
1
N - 2
h(key)
Application Probing visited only 9 of the 17
bins, but if the table is half empty, not all
those 9 bins can be occupied, so we must be able
to insert a new element in one of them.