Results 1 to 12 of 12
Thread: understanding of hash functions
- 06-18-2012, 08:39 PM #1
Senior Member
- Join Date
- Nov 2010
- Posts
- 155
- Rep Power
- 3
understanding of hash functions
I read about hash table and Hash functions on wikipedia, becuase I have to use HashTable in a code, but I can't understand the Hash functions quite properly, now from what I read, it said its like a map with each key having several values, is it correct?
What about HashSet in the Java Docs, it said its backed by a HashMap, but what's it use?
Thanks
- 06-18-2012, 08:46 PM #2
Re: understanding of hash functions
Do you really need to fully understand hash functions in order to use Hashtable?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-18-2012, 08:49 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: understanding of hash functions
The fact that a HashSet is implemented/backed by a HashMap is an 'implementation detail' and is none of our business as long as the HashSet implements the Set interface.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-18-2012, 08:50 PM #4
Senior Member
- Join Date
- Nov 2010
- Posts
- 155
- Rep Power
- 3
Re: understanding of hash functions
No, but I want to know how it works, to better understand it.
But is this part correct:
its like a map with each key having several values, is it correct?
- 06-18-2012, 09:15 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: understanding of hash functions
One key in a HashMap can only have one value associated with it and all keys have to be unique according to their equals( ... ) method.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-18-2012, 09:21 PM #6
Senior Member
- Join Date
- Nov 2010
- Posts
- 155
- Rep Power
- 3
- 06-18-2012, 09:23 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: understanding of hash functions
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-18-2012, 09:27 PM #8
Senior Member
- Join Date
- Nov 2010
- Posts
- 155
- Rep Power
- 3
Re: understanding of hash functions
Ohhh, okay
But I'm getting a little confused here lol
Do you mean that in a map values are not unique but in hash map they are unique?
Sorry for the long discussion but I want to grasp a better understanding of it
- 06-18-2012, 09:31 PM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 06-18-2012, 09:34 PM #10
Senior Member
- Join Date
- Nov 2010
- Posts
- 155
- Rep Power
- 3
Re: understanding of hash functions
Then what's the use of Hash here?
- 06-18-2012, 10:08 PM #11
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: understanding of hash functions
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-18-2012, 10:12 PM #12
Senior Member
- Join Date
- Nov 2010
- Posts
- 155
- Rep Power
- 3
Similar Threads
-
Hash set
By lakshmibvaraprasad in forum New To JavaReplies: 2Last Post: 07-20-2011, 06:58 PM -
Hash-tables IO
By loopsnhoops in forum New To JavaReplies: 8Last Post: 06-01-2011, 09:55 AM -
Having trouble understanding how to use Hash Tables
By theBurgh22 in forum Advanced JavaReplies: 1Last Post: 03-04-2011, 11:19 PM -
Hash
By sandy1028 in forum New To JavaReplies: 4Last Post: 04-17-2009, 10:36 AM -
Hash Map
By rekha in forum New To JavaReplies: 1Last Post: 03-21-2009, 01:00 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks