hash function

Z

zoro

i didn't understand what does it mean for a hash function to produce
well-dispersed output, and why it is important?

thank u for ur help
 
M

Mirek Fidler

zoro said:
i didn't understand what does it mean for a hash function to produce
well-dispersed output, and why it is important?

Well, let us start with what is the worst possibility here w.r.t.
dispersing:

Hash function that returns always zero (or other constant number) is
valid, but alters hashing search operation to linear search.

By well-dispersed is meant the "opposite" to this situation... (as many
different values for different keys as possible).

Mirek
 
N

Nikolaos D. Bougalis

zoro said:
i didn't understand what does it mean for a hash function to produce
well-dispersed output, and why it is important?

This almost sounds like homework, so I won't give you a direct answer.
Instead consider the yellow pages (or a telephone book) as a very simple
example of hashing:

Telephone books usually use a hash function that says "return the first
character of the input" and proceeds to put the item in the appropriate
section (A for Alf, B for Bobo, C for Cirdan, etc).

But consider what would happen if the telephone book used the hash function:
"return 'A' for any input" instead.

Now, assuming that all letters are equally likely to begin a name, the first
function produces input that is well-dispersed. The second one does not. As
for why it is important for the hash to produce well-dispersed output, I would
hope that by now it has become clear.

-n


P.S.: Yes, I realize that my example is not perfect. But it was not meant to
be and it does get the point across.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top