Re: maintenance of hash tables.
- From: Andrew Tomazos <andrew@xxxxxxxxxxx>
- Date: Mon, 29 Jun 2009 06:47:19 -0700 (PDT)
On Jun 29, 11:58 am, mohangupta13 <mohangupt...@xxxxxxxxx> wrote:
hello everyone,
This may sound pretty basic but still I have this doubt.
It is know that to maintain the constant time operations in a hash
table the number of elements in the table should be proportional to
the slots in the table.
But I have seen in a lot many places that to maintain this, whenever
the number of elements in a hash table reach half the table size ,the
size of the table is doubled.
Why this factor of 2 (only) is chosen most of the time??
Look at this diagram:
-A
-BB
-
-CCCC
-
-
-
-DDDDDDDD
-
-
-
-
-
-
-
Now look what happens when I let the towers hang down:
-A
-B
-B
-C
-C
-C
-C
-D
-D
-D
-D
-D
-D
-D
-D
Enjoy,
Andrew.
.
- References:
- maintenance of hash tables.
- From: mohangupta13
- maintenance of hash tables.
- Prev by Date: Re: maintenance of hash tables.
- Next by Date: Airlines
- Previous by thread: Re: maintenance of hash tables.
- Next by thread: Re: maintenance of hash tables.
- Index(es):
Relevant Pages
|