What is Hash Table, how to create a hash table?

How would you insert a node in a hash table?

  • To insert some thing into a hash table you need to have a hash function. So, what kind of hash functions would you use for NODES(say an object referencing a node)?

  • Answer:

    Hash functions are used on the keys which can be integers. 'Key' field is a part of the node that you want to store in a hashtable. Nodes or the objects referencing the nodes can be stored in a linked list where its head pointer is stored in the hash table.

Sagar Gupta at Quora Visit the source

Was this solution helpful to you?

Other answers

There are plenty of hash functions available and used extensively. But whatever hash functions you use, you need to try to minimize hash collisions to almost negligible. There are plenty of simple hash functions like division function, multiplication one...or you can even use hash functions like md5, sha..etc.

Robin Thomas

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.