Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 Hash Table Load Factor (30 pts) We want to store a set of n keys into a hash table H, that is of size

image text in transcribed

4 Hash Table Load Factor (30 pts) We want to store a set of n keys into a hash table H, that is of size m and uses chaining as the collision resolution method. In this problem you will prove that if the keys are drawn from a universe U of size U>nm, then regardless of what hash function we use, the worst case runtime for searching in H is (n). (a) (5 pts) What is the upper bound for the runtime of searching in H in the worst case? Use big- O notation and justify your answer. (b) (15 pts) Prove that no matter what hash function we use, U always contains a subset of size n consisting of keys that all hash to the same slot. (Hint: assume that there is no such subset and find a contradiction.) (c) (5 pts) What does the claim in part (b) say about the lower bound on the runtime of searching in H (d) (5 pts) Combine your answers to parts (a) and (c) to conclude that the runtime for searching for a key in H is (n) in the worst case. How does it compare to searching for an item in a red-black tree, which contains n items from the universe U ? When would we want to use a hash table and when would we want to use a red-black tree as a data structure to store and search for items

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

6. Describe why communication is vital to everyone

Answered: 1 week ago