Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello I need help with this problem as soon as possible if possible thank you very much. Hashing In this problem, you will think about

Hello I need help with this problem as soon as possible if possible thank you very much.

image text in transcribedimage text in transcribedimage text in transcribed

Hashing In this problem, you will think about how lazy deletion is handled in open-addressing hash tables. Recall that in lazy deletion, we mark the cell that contained a deleted item with a flag to indicate an element used to be here but is not here anymore. Probing (for find ) then continues past any flagged cells, but an insert can reuse any such cell. You should NOT assume that any changes other than those specifically stated are made to the hashtable (e.g. operations still work exactly the same way as we discussed in lecture). For both part a) and part b) we are asking you to compare the proposed modification to how an open addressing hash table with lazy deletion would normally work. We have an open addressing hash table that uses lazy deletion. The cell x is marked as deleted. Consider the following two proposed modifications to how the f ind operation works. Use the diagram below to explain your answer for both modifications: a) Proposed modification A: i) While probing, a successful find operation hits and moves past cell x and finds the key it is looking for in cell Y. ii) The f ind operation then moves the found key to cell x, marks cell x as no longer deleted, and marks cell Y as deleted (it contains no value, but we treat it as a collision). This is a recursive operation. iii) The find operation then returns the found value. If this proposed modification is used, would the resulting hash table work better or worse on average than a normal open addressing hash table using lazy deletion? Just say it's "Better" or "Worse". Solution: Explain your answer. Focus on how the modification would impact the find operation. Limit your answer to 4 - 5 short sentences. b) Proposed modification B: i) While probing, a successful find operation hits and moves past cell x and finds the key it is looking for in cell Y. ii) The f ind operation then moves the found key to cell X, marks cell X as no longer deleted, and marks cell Y as open (as if it had never had a value in it). iii) The f ind operation then returns the found value. If this proposed modification is used, would the resulting hash table work better or worse on average than a normal open addressing hash table using lazy deletion? Just say it's "Better" or "Worse". Solution: Explain your answer. Focus on how the modification would impact the find operation. Limit your answer to 4 - 5 short sentences

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

10. Insults or criticizes subordinates in front of others

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 399

Answered: 1 week ago

Question

Identify the cause of a performance problem. page 380

Answered: 1 week ago