Hash Tables

Hash tables are also called ‘Maps’ at times. To be honest, hash table is just another scary term for a list of key-value pairs!

What is a Hash Table?

A Hash table is a data structure which contains a list (mind you, this can be any type of list - an Array, a Linked List, a doubly linked list or something else) of Key-Value pairs. As already mentioned, they are also called Maps. A Hash Table is not always a Table but it would be easy to visualize them as one. They look something like this:

10 John
7 Steve
37 Craig
22 Bill

There are two things to keep in mind here: