Zeek_94_ Hashing in Java

 

What is hashing in Java and why it is used?


--> Hashing In Java is a technique that is used for mapping values to the key,

      which in turn makes it easy to retrieve values by just entering the key


What is hashing with example?

Hashing is an important data structure designed to solve the problem of efficiently finding and storing data in an array.

For example,

if you have a list of 20000 numbers, and you have given a number to search in that list- 

you will scan each number in the list until you find a match.This is inefficient.

Searching among 20000 numbers becomes efficient if you use concept of hashing


Characteristics of Hashing Algorithm


A good hashing algorithm must have following characteristics:

  • The hashing algorithm must be quick enough to hash any sort of data.
  • The algorithm should avoid the regeneration of message from its generated hash value (one way).
  • The two messages must not have the same hash at any point of time. In other words, the hashing algorithm must avoid the collision.
  • The hash value of the message must change when there is even a slight change to the message. It is known as the avalanche effect

Comments

Popular posts from this blog

Zeek_31_MethodInJava.java