First of all, hash<anything> means that you are implementing <anything> using a hash function of some kind that will give you a bucket index to find whatever you are looking for efficiently.
That being said, hashtable is a table implemented with a hash function, hashmap is a map implemented this way, and likewise for hashset.
A table, a map, and a set are just different data structures to store things.
In general, a table is a collection of "records". You may think of a table in python as a list of lists (of lists,...). For example: [[studentname, phonenumber, birthdate, [friend1,friend2,...]...],...].
A map is collection of "key"-"value" pairs. Essentially we have a collection of mappings from keys to values, e.g. keywords to urls. A hashmap then is an efficient way to add/lookup keys and their corresponding values. I'm not certain, but I think the dictionary we used is a hashmap, not so much a hashtable (though similar).
A set is just a collection of elements. In C++, a set would have to be a collection of elements of the same "type", such as integers, or strings, but not a mix. I'm not quite so sure there is a distinction for sets in Python, since we can just use lists to hold any type of element we want.
Not aware of any other types of hash.
Hope this helps!
answered
04 Apr '12, 03:32
Stanley Xu
178●9