Computer Science, asked by syed15aashir, 2 months ago

Hashing has different functions like division mode and mid square mode
I need to ask is that can we implement it using coding ?

Answers

Answered by mafattah
1

Answer:

Yes, using the algorithms of these methods both the functions can be implemented

Explanation:

Division method/remainder method =

H(item) = item % 11

Eg: If an item is 94 then the hash value will be = 94 mod 11

= 6

Mid square method involves squaring the item and extract the middle portion of the square and then apply the division method on that number.

Eg: If an item is 43 then square it = 43 * 43 = 1849

Extract middle portion 2 digits = 84

Then apply division method = 84 mod 11 = 7

Similar questions