Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
) mod m
= (h(k) +
) mod m
Thus this is an instance of quadratic probing with c
1
= c
2
= 1/2.
Proof: By induction.
Induction Hypothesis: i
n
= (h(k) +
) mod m
Base: i
0
= h(k) mod m = (h(k) +
) mod m
Step: Assume the IH holds for n. We will prove that it holds for n + 1:
i
n+1
= (i
n
+ j
n+1
) mod m = (i
n
+ n + 1) mod m
= ((h(k) +
+ n + 1) mod m
= (h(k) +
) mod m
b) m = 2
n
To prove that all table positions are examined in the worst case, it is sufficient to prove
that none of the position is visited twice during the probing sequence. This mean for
every arbitrary u, v < m and u v:
i
u
i
v
(h(k) +
) mod m (h(k) +
) mod m
(h(k) +
) - (h(k) +
) bm (b Z)
bm
Proof: By contradiction
When (u v) is even, (u + v + 1) is odd. Thus for
to be a multiple of m = 2
n
,
must be a multiple of m
to be a multiple of m = 2
n
,
must be a multiple of m