What is Hashing, Hash Table and Hash Function?

Hashing is a technique in which the keys, values are stored in Hash Table using a function known as Hash Function.

What is Hash Table?

In the Hashing technique, we require some kind of storage (mostly we use arrays) to store the values and that storage can be termed as Hash Table.

What is Hash Function?

Hash Function is responsible for mapping keys and values in the Hash table.

Hashing is a technique, Hash Table is storage, and Hash Function is just a function nothing fancy other than this.

Why do we need Hashing?

With the hashing technique, we can insert, retrieve and search the values with almost constant time complexity (O(1)). For example in arrays searching an element would take O(n) time. Hashing works as an effective technique if we want to create a look-up storage where we want to access the data faster (in O(1) time complexity).

In java, we have HashMap and HashSet as the implementation of the hash tables.

We can implement our hashing, in the next article I would be covering that.