In the context of CS, how the hash-table and hash-map are different?

I was watching a part of "Algorithm with Swift" video in Udacity, and I discovered the terms "hash-table" and "hash-map" are somewhat confusing.

As far as I understand,

  • hash table → stores keys only → Swift Set.
  • hash map → stores key/value pairs → Swift Dictionary.

But, Wikipedia is talking hash-table is same thing with hash-map. Here I could not find any help.

Is this formal or widely accepted CS term? Am I understanding correctly? If I'm wrong, please correct me. Thanks.

I know industry uses their own terms that can be different, and I am asking about academia because I believe terms are more consistent in academia. If it's not, I just would abandon to learn academic terms.


1 Answer 1


If you ask me, you're correct and Wikipedia is wrong, as the complaints on the article's talk page (some 11 years ago!) clearly explain, but it was never fixed (or it was fixed and reverted).

A hash table stores items; these items can be keys (in which case it implements a set), or key-value pairs (in which case it implements a map, i.e. a hash map), or perhaps something else, e.g. triples; the Wikipedia article describes only the key-value case, while I was only taught the key-only case in class.

Some people do use hash table to mean hash map, so Wikipedia successfully describes a particular usage of the term; it should also describe the other cases. (It does describe how a hash map can be used to implement a set and other data structures, but that's not the same thing.)

In IT, most terms mean different things to different people, and most people using the term in one sense aren't aware that other people use it in another sense; hash table is no exception.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.