what is hashing

Answer Posted / pavan

Hash Table: is a data structure in which keys are mapped to array positions by a hash function. This table can be searched for an item in O(1) time using a hash function to form an address from the key. The easiest way to conceptualize a hash table is to think of it as an array. When a program stores an element in the array, the elements key is transformed by a hash function that produces array indexes for that array.

Hash Function: is a function which, when applied to the key, produces an integer which can be used as an address in a hash table. The intent is that elements will be relatively randomly and uniformly distributed. In the example above the code for the hash function would look like this (assuming TABLE_SIZE was defined 100):

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the need of sorting?

516


Is pointer a variable?

505


Explain the Linked List

646


Is hashmap sorted?

513


How to reverse singly link list?

541






How many null values are allowed in hashmap?

511


Which is best book for data structures?

525


What is the order of b tree?

546


What is the purpose of thread?

509


What are the applications of priority queues?

524


Who created quicksort?

523


Give a good data structure for having n queues ( n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.

563


What are the topics in data structures?

511


What member function places a new node at the end of the linked list?

643


What are the properties of binary heap?

551