Time Complexity Hashing

46 views Asked by At

I'm working on an assignment for creating a hash table and one of the questions asks

If we have M documents, and document Di consists of Ni words, then how long does this simple solution take to search for a query consisting of K words. Give your answer in big O notation.

I assumed that the answer would be big O(M⋅N).

Also, the second part asks if we use the hash function to be more efficient and all words map evenly across all buckets, what would the big O notation be?

I assumed this answer to be big O(B/N) where B is the number of buckets.

Are these correct?

0

There are 0 answers