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
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
Related Q & A:
- How can I insert a picture in Email without attaching it?Best solution by Super User
- How do you insert a picture on yahoo when you ask a question?Best solution by Yahoo! Answers
- How do you insert a picture into a Wikipedia article?Best solution by Yahoo! Answers
- How do i insert a picture in an article on Wikipedia?Best solution by Yahoo! Answers
- How do I insert a picture into an actual mail message?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.