Question

1) What’s the (worst-case) running time of Hash Table Search for collision resolution by chaining? Express...

1) What’s the (worst-case) running time of Hash Table Search for collision resolution by chaining? Express your answer in asymptotic notation. Use the standard notation where n is number of keys and m is number of slots.

2) What’s the (worst-case) running time of Hash Table Search for collision resolution by open-addressing? Express your answer in asymptotic notation. Use the standard notation where n is number of keys and m is number of slots.

3)What simple change in BucketSort can improve its worst-case running time performance by a multiplicative factor of n/lgn?

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

(1)worst case : when all (n)keys get the same slot in Hash Table making a chain of length (n).Therefore in this case for searching a key we need to traverse the complete chain (in worst case).Hence worst case time complexity = O(n).

(2)worst case : when all the slot in Hash Table are filled by key .Therefore in this case for searching a key we need to traverse all the slots in open Hashing.Hence worst case time complexity = O(m).

(3)If we replace Insertion Sort by Merge Sort in Bucket sorting, and if ith bucket has ni elements, sorting ith bucket would take ni log ni < ni log n steps. Thus, sorting all buckets will take O(n log n) steps.It can improve its worst-case running time performance by a multiplicative factor of n/lgn

Add a comment
Know the answer?
Add Answer to:
1) What’s the (worst-case) running time of Hash Table Search for collision resolution by chaining? Express...
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
ADVERTISEMENT