What is the worst-case performance of a lookup operation in a hashmap and why? Group of answer choices A- O(1), hashmap always has a constant time lookup, and that is why we like using this...


What is the worst-case performance of a lookup operation in a hashmap and why?


Group of answer choices

A- O(1), hashmap always has a constant time lookup, and that is why we like using this associative data structure.




B- O(lg(n)) hashmap has a log(n) lookup because we are able to perform a binary search on the keys because our hashmap always maintains a sorted order of entries added.




C- O(n) because we can have a bad hash function that puts all of our items in the same bucket, thus we would have to iterate through all n items.




Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here