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 Singly Linked list?

576


Are sets sorted?

514


What is sequential search? What is the average number of comparisons in a sequential search?

453


What is a property class?

506


What is difference between concurrenthashmap and hashtable?

420






What is data type explain?

715


What is array and its types in data structure?

498


Which is better merge sort or quick sort?

467


What is two-dimensional array?

520


How do you implement a stack?

476


How efficient is bubble sort?

503


Which collection is fail safe?

483


How do you make a bubble chart with 3 variables?

467


What is the Role of push() and pop() method?

526


What is a multidimensional array?

530