Member-only story

The Basics of Hash Table

Hash table is fundamentally a data structure that offers fast insertion, lookup and deletion

billydharmawan
TDS Archive
8 min readSep 14, 2021

--

Photo by Russ Ward on Unsplash

Those of us who’ve lived reasonably long enough must know or at least have seen a yellow page. Yup! You’re right. It is the thick yellow book containing directories of businesses and their phone numbers. This enables us to search for a business that sells what we need and contact them.

(I don’t think Gen Z and the next generations after that would come to know about this thick yellow book. 😆)

A directory of phone number is usually alphabetically ordered, so we know where we can start our search. Once we find the business name that we want, we can grab the phone number and call them. You get the idea. 💡

Photo by Foto Sushi on Unsplash

Hash Table

What if I tell you that a yellow page or a phone book is an implementation of hash table? You bet! 🐴

Hash table is essentially an array coupled with a hash function. It is commonly used to store key-value data, for example, businesses and their phone number, students and their grades, items and their prices and many more, in an unordered…

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

billydharmawan
billydharmawan

Written by billydharmawan

An ordinary man trying to leave a good legacy on earth

Responses (1)