Tuesday, June 21, 2016

Hash Tables example in core java

What is Hash Tables?

A Hash Table is a data-structure that offers very fast insertion and searching. It takes close to constant time O(1) in big O notation.
Hash Tables do have several disadvantages. They are based on arrays and arrays are difficult to expand after they have been created.Also,there is no convenient way to visit the items in a hash table in any kind of order.

Introduction to Hashing

One important concept is how a range of key values is transformed into a range of array index values.In a hash table this is accomplished using hash function.
What we need is a way to compress the huge range of numbers we obtain from the numbers-multiplied-by-powers system into a range that matches a reasonably sized array.
So an array into which data is inserted using a hash function is called hash table.


No comments: