What is a hash table?

Category: QuestionsWhat is a hash table?
Editor">Editor Staff asked 1 month ago

What is a hash table?
 
(a) A structure that maps values to keys
 
(b) A structure that maps keys to values
 
(c) A structure used for storage
 
(d) A structure used to implement stack and queue
 
My query is from Hash Tables topic in chapter Hash Tables of Data Structures & Algorithms I
 
This question was addressed to me during a job interview.

1 Answers
Editor">Editor Staff answered 1 month ago

Correct option is (b) A structure that maps keys to values
 
The best explanation: A hash table is used to implement associative arrays which has a key-value pair, so the has table maps keys to values.