Question

thoblerm 1: (25 pts) Explain how the time efficieney of this a to use hashing to check whether all elements of a list are dis
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In hashing we will first create hash function and then we will compute hash value for all the elements which involves O(n) complexity and then each element will compare against the hash values if there is only one match for all the elements are distinct and it involves O(n)

          total complexity is O(n+n) == O(n)

for brute force algorithm it takes complexity of O(n^n);

for pre-sorting algorithm it takes complexity of O(nlogn);// because it involves sorting and then binary search

Add a comment
Know the answer?
Add Answer to:
thoblerm 1: (25 pts) Explain how the time efficieney of this a to use hashing to...
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
ADVERTISEMENT