Question
Will you provide a brief explanation with the answer please?
1.3 Suppose we are implementing quadratic probing with a hash function Hash(X)= X mod 100. If an element with key 4594 is ins
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: c) 9

Quadratic Probing We look for i2‘th slot in i’th iteration.

let hash(x) be the slot index computed using hash function.  
If slot hash(x) % S is full, then we try (hash(x) + 1*1) % S
If (hash(x) + 1*1) % S is also full, then we try (hash(x) + 2*2) % S
If (hash(x) + 2*2) % S is also full, then we try (hash(x) + 3*3) % S

......................................................................................................................................

Here we have the hash function hash(X) = X mod 100

for the given key value X = 4594

First Attempt

the hash value yielded would be 4594 mod 100 = 94

It was given that the first three locations attempted were already occupied

So the location 94 was occupied.

Second Attempt

As we are using Quadratic probing We look for i2‘th slot in i’th iteration.

So the first i2 index would be 1*1 = 1

The second attempted location was occupied as well.

Third Attempt

The next i2 value would be 2 * 2 = 4

The third attempted location was occupied as well

Fourth Attempt (Question)

The next i2 value would be 3 * 3 = 9

-------------------------------------------------------------------------------

The next cell will be tried is 9

============================================================================

Hope this helps!

Please let me know if any changes needed.

Thank you!

I hope you're safe during the pandemic.

Add a comment
Know the answer?
Add Answer to:
Will you provide a brief explanation with the answer please? 1.3 Suppose we are implementing quadratic...
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
  • Please provide a brief but precise explanation of your answers. You throw a dart at a...

    Please provide a brief but precise explanation of your answers. You throw a dart at a circular target of radius r. Let X be the distance of your dart's hit from the center of the target. Your aim is such that X is an exponential distribution with parameter 4/r (a) As a function of r, determine the value m such that P(X < m) = P(X > m). (b) What is the probability that you miss the target completely?

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

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