easy explanation of hash tables

aziz sassi
1 min readFeb 5, 2021

A hash table is a Data structure that pairs keys to values .

Let’s say that we have a football team each player have his value in the team and has a number so anyone can recognize him hash tables are pretty similar to that the only thing that change that we have a machine that give a reference to each player so we can call him directly without going through all the team players and we can do actions like adding new players and deleting players also changing their position maybe .

In real hash tables the team is the array that will contain the players which are arrays which have a key and a value which are the number of the player and the value of the player and the machine is the hash function that will give us a reference to our key so we don’t have to loop through that array each time we need and specific array or type the index that will not be a good practice when dealing with a lot of data with that reference we can call the array directly

And another thing we have a limit in our array whenever we reach 75% of that array or whatever we set it really depends it will add more space in the array

Hope you guys understand the concept of hash table it really can be confusing sometimes but with practice you will get better at this .

--

--

aziz sassi

👋 Hey! I'm Aziz, a passionate software developer from Tunisia. Let's explore the world of programming together! 🚀💻 #TechEnthusiast