|
 |
aspx_beginners thread: What is a HashTable?
Message #1 by "John Hamman {Hamman Interactive}" <johnhamman@C...> on Thu, 11 Jul 2002 13:40:06 -0400
|
|
Can anyone explain to me what a hashtable is?
john
Message #2 by "McCloy, Russell" <Russell.McCloy@B...> on Fri, 12 Jul 2002 11:40:58 +1000
|
|
Isnt it just a paired list like:
russell - 2
john - 34
Timbo - 41
Roger - 11
I could be wrong!
-----Original Message-----
From: John Hamman {Hamman Interactive} [mailto:johnhamman@C...]
Sent: Friday, 12 July 2002 3:40 AM
To: aspx_beginners
Subject: [aspx_beginners] What is a HashTable?
Can anyone explain to me what a hashtable is?
john
Message #3 by "jeby" <jeby@c...> on Fri, 12 Jul 2002 12:51:22 +0530
|
|
A hash table is a dictionary style object! each of the item in the hash
table will have a key and a value.
-----Original Message-----
From: McCloy, Russell [mailto:Russell.McCloy@B...]
Sent: Friday, July 12, 2002 7:11 AM
To: aspx_beginners
Subject: [aspx_beginners] RE: What is a HashTable?
Isnt it just a paired list like:
russell - 2
john - 34
Timbo - 41
Roger - 11
I could be wrong!
-----Original Message-----
From: John Hamman {Hamman Interactive} [mailto:johnhamman@C...]
Sent: Friday, 12 July 2002 3:40 AM
To: aspx_beginners
Subject: [aspx_beginners] What is a HashTable?
Can anyone explain to me what a hashtable is?
john
Message #4 by David Barnes <DavidB@w...> on Fri, 12 Jul 2002 14:05:47 +0100
|
|
Hi all
Let's say you want to build a telephone directory in the computer's memory.
You want to be able to search on name, and get a phone number back. So, as
Jeby says, you have a key (name) and value (phone number).
However, searching on a string is pretty slow. This is where the 'hash' in
hash table comes in. When you add an entry, for example:
"David Barnes", 123 456 789
to the hash table, a mathematical calculation is perfomed on the key ("David
Barnes"), resulting in a number. This is called hashing. So what gets added
behind the scenes is more like:
8651243, "David Barnes", 123 456 789.
Then when I want to find my phone number, I do a search for "David Barnes".
The same calculation is perfomed on the search term as was performed when I
added the value, so what gets searched for internally is:
8651243
Which quickly returns the result 123 456 789.
A hashtable is useful when the time taken to calculate a hash value and then
search for it is LESS than the time taken to search on the key value itself
(in this case a string).
This is quite a simplistic definition, but as far as I can remember covers
the main points. I hope it helps!
David
> -----Original Message-----
> From: McCloy, Russell [mailto:Russell.McCloy@B...]
> Sent: Friday, July 12, 2002 2:41 AM
> To: aspx_beginners
> Subject: [aspx_beginners] RE: What is a HashTable?
>
>
> Isnt it just a paired list like:
>
> russell - 2
> john - 34
> Timbo - 41
> Roger - 11
>
> I could be wrong!
>
> -----Original Message-----
> From: John Hamman {Hamman Interactive} [mailto:johnhamman@C...]
> Sent: Friday, 12 July 2002 3:40 AM
> To: aspx_beginners
> Subject: [aspx_beginners] What is a HashTable?
>
>
> Can anyone explain to me what a hashtable is?
> john
>
>
>
>
Message #5 by bob.szymanski@p... on Fri, 12 Jul 2002 08:16:52 -0500
|
|
This is a multipart message in MIME format.
--=_alternative 00488BD086256BF4_
Content-Type: text/plain; charset="us-ascii"
I found this interesting web page that goes into defining what a hashtable
is in great detail.
http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/hash_tables.html
Bob
--------------------------------------------------------------
Robert Szymanski
Software Engineer
PHILIPS SEMICONDUCTORS
9651 Westover Hills Blvd.
San Antonio, Texas 78251
Tel: xxx-xxx-xxxx
Fax:210-522-7327
www.semiconductors.philips.com
E-mail:bob.szymanski@p...
"jeby" <jeby@c...>
07/12/2002 02:21 AM
Please respond to "aspx_beginners"
To: "aspx_beginners" <aspx_beginners@p...>
cc: (bcc: Bob Szymanski/SAT/SC/PHILIPS)
Subject: [aspx_beginners] RE: What is a HashTable?
Classification:
hash table is a dictionary style object! each of the item in the hash
table will have a key and a value.
-----Original Message-----
From: McCloy, Russell [mailto:Russell.McCloy@B...]
Sent: Friday, July 12, 2002 7:11 AM
To: aspx_beginners
Subject: [aspx_beginners] RE: What is a HashTable?
Isnt it just a paired list like:
russell - 2
john - 34
Timbo - 41
Roger - 11
I could be wrong!
-----Original Message-----
From: John Hamman {Hamman Interactive} [mailto:johnhamman@C...]
Sent: Friday, 12 July 2002 3:40 AM
To: aspx_beginners
Subject: [aspx_beginners] What is a HashTable?
Can anyone explain to me what a hashtable is?
john
Message #6 by "Allan Williams" <allan@a...> on Fri, 12 Jul 2002 11:55:53 -0400
|
|
heres the definition of a hash table from Inside MS SQL Server 2000.
Quoted from pg 841:
Hashing lets you determine whether a particular data item matches an already
existing value by dividing the existing data into groups based on some
property. You put all the data with the value in what we call hash bucket.
Then, to see if a new value has a match in existing data, you simply look in
the bucket for the right value.
as an example:
consider a mechanic with a pile of wrenches, he could put all 1/2 inch
wrenches into a single draw, then when he needed one, he would go to the 1/2
inch wrench drawer to see if there was one in there. (maybe it had been
borrowed and never returned.)
When hashing data, you will need a property to group by. Our mechanic used
wrench size, but you can use what ever makes the most since for you.
Hope this helps
-->Allan
-----Original Message-----
From: jeby [mailto:jeby@c...]
Sent: Friday, July 12, 2002 3:21 AM
To: aspx_beginners
Subject: [aspx_beginners] RE: What is a HashTable?
A hash table is a dictionary style object! each of the item in the hash
table will have a key and a value.
-----Original Message-----
From: McCloy, Russell [mailto:Russell.McCloy@B...]
Sent: Friday, July 12, 2002 7:11 AM
To: aspx_beginners
Subject: [aspx_beginners] RE: What is a HashTable?
Isnt it just a paired list like:
russell - 2
john - 34
Timbo - 41
Roger - 11
I could be wrong!
-----Original Message-----
From: John Hamman {Hamman Interactive} [mailto:johnhamman@C...]
Sent: Friday, 12 July 2002 3:40 AM
To: aspx_beginners
Subject: [aspx_beginners] What is a HashTable?
Can anyone explain to me what a hashtable is?
john
Message #7 by "John Hamman {Hamman Interactive}" <johnhamman@C...> on Fri, 12 Jul 2002 12:04:18 -0400
|
|
Wow, I must say that this has been the best responses i have seen. Thanks so
much everyone.
john
|
|
 |