Question

ZOOM Page 7. Apply the following operations on the following Quadratic probing haslh table. Write down all your calculations

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Insert table 17

Hash1(17)= 17%16 =1

Hash2(17) = 11- 17%11 =11- 6=5

When i=1

Location = (Hash1(17)+ i* Hash2(17))%16

              = ( 1 + 1* 5) % 16

             = (6)%16

            = 6

Which is already occupied

When i=2

Location = (Hash1(17)+ i* Hash2(17))%16

              = ( 1 + 2* 5) % 16

             = (11)%16

            = 11

Which is free

so 17 will be placed in location 11 as follows

32 49 16 23 24 42 17 99 0 1 2 3 5 6 78 9 10 11 12 13 14 15

b) To remove value 16

Hash1(16)= 16%16 =0

Hash2(16) = 11- 16%11 =11- 5=6

When i=1

Location = (Hash1(16)+ i* Hash2(16))%16

              = ( 0 + 1* 6) % 16

             = (6)%16

            = 6

Location 6 has the value 16 . The delete the element 16 from table. New hash table will be like

32 49 2324 42 1799 0 1 23 5 6 7 8 9 10 11 12 13 14 15

Add a comment
Know the answer?
Add Answer to:
ZOOM Page 7. Apply the following operations on the following Quadratic probing haslh table. Write down all your calculations and changes to the hash table Hashi (key): key % 16 Hash2(key): 11-key % 1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT