Question

Describe how to perform a removal from a hash table that uses linear probing to resolve...

Describe how to perform a removal from a hash table that uses linear probing to resolve collisions. What is its worst-case time complexity?

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

method to perform a removal from a hash table that uses linear probing to resolve collisions:(using additional array called flag)
-first find hashcode(or index given by hash function)
-then probe the array, starting from the index given by hash function, until a element to be deleted is found or the value at this index in flag array is 0
-in each iteration update index i: by (i+1)%size of hash table
-if element is found then set value at current index to null, and upta flag value at current index to 2 and decrease hash table capacity

worst case complexity would be :O(n)//where n is the size of hash table

Add a comment
Know the answer?
Add Answer to:
Describe how to perform a removal from a hash table that uses linear probing to resolve...
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
Active Questions
ADVERTISEMENT