<s>
2-choice	B-Algorithm
hashing	I-Algorithm
,	O
also	O
known	O
as	O
2-choice	O
chaining	O
,	O
is	O
"	O
a	O
variant	O
of	O
a	O
hash	B-Algorithm
table	I-Algorithm
in	O
which	O
keys	O
are	O
added	O
by	O
hashing	O
with	O
two	O
hash	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
The	O
average-case	B-General_Concept
cost	I-General_Concept
of	O
a	O
successful	O
search	O
is	O
,	O
where	O
is	O
the	O
number	O
of	O
keys	O
and	O
is	O
the	O
size	O
of	O
the	O
array	O
.	O
</s>
<s>
2-choice	B-Algorithm
hashing	I-Algorithm
utilizes	O
two	O
hash	B-Error_Name
functions	I-Error_Name
h1(x )	O
and	O
h2(x )	O
which	O
work	O
as	O
hash	B-Error_Name
functions	I-Error_Name
are	O
expected	O
to	O
work	O
(	O
i.e.	O
</s>
<s>
The	O
two	O
hash	B-Error_Name
functions	I-Error_Name
should	O
be	O
independent	O
and	O
have	O
no	O
correlation	O
to	O
each	O
other	O
.	O
</s>
<s>
Having	O
two	O
hash	B-Error_Name
functions	I-Error_Name
allows	O
any	O
key	O
x	O
to	O
have	O
up	O
to	O
two	O
potential	O
locations	O
to	O
be	O
stored	O
based	O
on	O
the	O
values	O
of	O
the	O
respective	O
outputs	O
,	O
h1(x )	O
and	O
h2(x )	O
.	O
</s>
<s>
It	O
is	O
important	O
to	O
note	O
that	O
,	O
although	O
there	O
are	O
two	O
hash	B-Error_Name
functions	I-Error_Name
,	O
there	O
is	O
only	O
one	O
table	O
;	O
both	O
hash	B-Error_Name
functions	I-Error_Name
map	O
to	O
locations	O
on	O
that	O
table	O
.	O
</s>
<s>
Insertion	O
:	O
When	O
inserting	O
the	O
values	O
of	O
both	O
hash	B-Error_Name
functions	I-Error_Name
are	O
computed	O
for	O
the	O
to-be-inserted	O
object	O
.	O
</s>
<s>
As	O
is	O
true	O
with	O
all	O
hash	B-Algorithm
tables	I-Algorithm
,	O
the	O
performance	O
is	O
based	O
on	O
the	O
largest	O
bucket	O
.	O
</s>
<s>
Although	O
there	O
are	O
instances	O
where	O
bucket	O
sizes	O
happen	O
to	O
be	O
large	O
based	O
on	O
the	O
values	O
and	O
the	O
hash	B-Error_Name
functions	I-Error_Name
used	O
,	O
this	O
is	O
rare	O
.	O
</s>
<s>
Having	O
two	O
hash	B-Error_Name
functions	I-Error_Name
and	O
,	O
therefore	O
,	O
two	O
possible	O
locations	O
for	O
any	O
one	O
value	O
,	O
makes	O
the	O
possibility	O
of	O
large	O
buckets	O
even	O
more	O
unlikely	O
to	O
happen	O
.	O
</s>
<s>
The	O
expected	O
bucket	O
size	O
while	O
using	O
2-choice	B-Algorithm
hashing	I-Algorithm
is	O
:	O
.	O
</s>
<s>
Using	O
two	O
hash	B-Error_Name
functions	I-Error_Name
offers	O
substantial	O
benefits	O
over	O
a	O
single	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
There	O
is	O
little	O
improvement	O
(	O
and	O
no	O
change	O
to	O
the	O
expected	O
order	O
statistics	O
)	O
if	O
more	O
than	O
two	O
hash	B-Error_Name
functions	I-Error_Name
are	O
used	O
:	O
"	O
Additional	O
hash	B-Error_Name
functions	I-Error_Name
only	O
decrease	O
the	O
maximum	O
by	O
a	O
constant	O
factor.	O
"	O
</s>
<s>
Some	O
people	O
recommend	O
a	O
type	O
of	O
2-choice	B-Algorithm
hashing	I-Algorithm
called	O
two-way	O
skewed-associative	O
cache	O
in	O
some	O
CPU	B-General_Concept
caches	I-General_Concept
.	O
</s>
<s>
2-left	O
hashingusing	O
two	O
hash	B-Algorithm
tables	I-Algorithm
of	O
equal	O
size	O
n/2	O
,	O
and	O
asymmetrically	O
resolving	O
ties	O
by	O
putting	O
the	O
key	O
in	O
the	O
left	O
hash	B-Error_Name
tablehas	O
fewer	O
collisions	O
and	O
therefore	O
better	O
performance	O
than	O
2-choice	B-Algorithm
hashing	I-Algorithm
with	O
one	O
large	O
hash	B-Algorithm
table	I-Algorithm
of	O
size	O
n	O
.	O
</s>
