Answered step by step
Verified Expert Solution
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.
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started