Hashing (हैशिंग)

Hashing (हैशिंग):-

Hashing is a technique to convert large keys into indices of an array. It uses a hash function i.e.. 
हैशिंग वह युक्ति है जिसमे बड़ी की को ऐरे के इंडेक्स में परिवर्तित किया जाता है। यह हैश फंक्शन का प्रयोग करती है जो निम्न है -
  
h(x)= x % size_of_array 

Here, x is a key value which is divided by size_of_array and remainder of this division is an index of array where the value is being stored. 
यहाँ , x  एक की वैल्यू है जिसे ऐरे के साइज से विभाजित किया जाता है एवं शेषफल के रूप में ऐरे का इंडेक्स प्राप्त किया जाता है जिस पर वैल्यू का रखा जायेगा।   
The efficiency of mapping key to index depends on the hash function used.
किसी की को इंडेक्स में के साथ मैप करने की दक्षता, प्रयुक्त किये गए हैश फंक्शन पर निर्भर करती है।  


  







for example:-
उदहारण के लिए:-
Assume that Array size is 10 and set of keys is {134,149,151,187,165} then 
माना कि ऐरे का साइज 10 है एवं की का समूह {134,149,151,187,165} है तब  
h(134)=134 %10= 4 
h(149)=149 %10= 9
h(151)=151 %10= 1 
h(187)=187 %10= 7
h(165)=165 %10= 5 

after calculating set of index of array will be {4,9,1,7,5}.
गणना करने के पश्चात् ऐरे के इंडेक्स का समूह {4,9,1,7,5} होगा। 







Hash function(हैश फंक्शन):-

A hash function is a special function which is used to map large key values to small index values. The output of a hash function is called hash value/ hash code/ digest or hashes. These hashes are generally used for indexing a hash table. 

हैश फंक्शन एक विशेष प्रकार का फंक्शन होता है जिसमे बड़ी के वैल्यूज को छोटी किन्डेक्स वैल्यू में मैप किया जाता है। हैश फंक्शन के आउटपुट को हैश वैल्यू/ हैश कोड/ डाइजेस्ट या हेशेस कहा जाता है। इन हेशेस का प्रयोग हैश टेबल की इंडेक्सिंग में किया जाता है। 

Hash table(हैश टेबल):- 

Hash table is an array data structure which is used to store key values(hashes) at unique index.
हैश टेबल एक ऐरे डाटा स्ट्रक्चर है जिसका प्रयोग की वैल्यूज(हेशेस) को अद्वितीय इंडेक्स पर रखने के लिए किया जाता है।  

Types of Hashing(हैशिंग के प्रकार):-
 
1.) Static hashing(स्टैटिक हैशिंग)
2.) Dynamic hashing(डायनामिक हैशिंग)

No comments:

Post a Comment

Stack Data Structure, Push, Pop and Peek Operations , Applications of Stack

Stack is a linear data structure. It is collection of ordered data elements. It is also known as LIFO system (last in first out). It means i...