Hash Tables

Learn about the hash tables. Hash tables are required to store the data in key-value pairs for faster access on the keys.

Hashing is an efficient way to sort key values in memory. Hashing is used to get the values associated with the key very fast. Some examples of hash tables are:

  • Employee ID, which is used to extract all the records of an employee.

  • Stock ID, which is used to get the transaction of stock during the day/week/month.

  • Book ISBN number, which is used to extract author, pages, price, and other relevant information.

As we can see in the above examples, keys can go to a large number, and each are unique. The value associated with the key needs to be extracted fast. Hash tables do this work.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.