More for fun than anything else, the two methods (linear and quadratic hash) compete against each other.
While the clusters have not arrived, there is not much to choose between them. When the tables start to get fuller, the differences begin to appear.
The table used is smaller in size so that the effects start arriving quicker.
0
Linear
80
Max length is 1
So
after
breakfast
they
went
round
to
see
Piglet
and
Pooh
Max Length = 2
explained
as
they
went
that
Piglet
was
a
Max Length = 3
Very
Small
Animal
who
Max Length = 4
didn't
Max Length = 5
like
bouncing
and
asked
Tigger
not
to
be
too
Max Length = 15
Bouncy
just
at
first
And
Tigger
who
had
been
hiding
behind
trees
and
jumping
Max Length = 17
out
on
Pooh's
shadow
when
Max Length = 20
it
wasn't
looking
Max Length = 29
said
that
as
soon
as
they
had
a
few
haycorns
Max Length = 36
they
became
Quiet
and
Refined
So
by-and-by
they
knocked
at
the
door
of
Piglet's
house
0
Quadratic
80
Max length is 1
Next entry is:
So
So
after
after
breakfast
breakfast
they
they
went
went
round
round
to
to
see
see
Piglet
Piglet
and
and
Pooh
Pooh
Max Length = 2
explained
explained
as
as
they
they
went
went
that
that
Piglet
Piglet
was
was
a
a
Max Length = 3
Very
Very
Small
Small
Animal
Animal
who
who
didn't
didn't
Max Length = 4
like
like
bouncing
bouncing
and
and
asked
asked
Tigger
Tigger
Max Length = 5
not
not
to
to
be
be
too
too
Max Length = 7
Bouncy
Bouncy
just
just
at
at
first
first
And
And
Tigger
Tigger
who
who
had
had
been
been
hiding
hiding
behind
behind
trees
trees
and
and
jumping
jumping
out
out
on
on
Pooh's
Pooh's
shadow
shadow
when
when
Max Length = 8
it
it
wasn't
wasn't
looking
looking
Max Length = 10
said
said
that
that
as
as
soon
soon
as
as
they
they
had
had
a
a
few
few
haycorns
haycorns
they
they
became
became
Quiet
Quiet
and
and
Refined
Refined
So
So
by-and-by
by-and-by
they
they
knocked
knocked
at
at
the
the
door
door
of
of
Piglet's
Piglet's
house
house
Max Length = 13
Linear
Quadratic
LINEAR
(1)i = hash(KEY)
(2)If entry i empty or contains KEY exit
(3)Otherwise i = i + 1, goto (2)
QUADRATIC
(1)i = hash(KEY); inc = 1;
(2)If entry i empty or contains KEY exit
(3)Otherwise i = i + 1; inc = inc + 1 goto (2)
Sound Design by Paul Hopgood
Text from 'The House at Pooh Corner' by A. A. Milne
Linear
Linear
versus
versus
Quadratic
Quadratic
User Keys
User Keys